Head to the Google AI Studio and create an API key by pressing the blue button:
3. Copy the token
Either the config file via text editor in config/mc_talking-common.toml or via the in-game GUI. Set the token and your desired speaking language:
#This key is used to authenticate with the Gemini API. You can get one at https://aistudio.google.com/apikey
gemini_key = "Put your API key here"
(The free tier allows up to 3 citizens to be spoken at the same time)
Usage
Craft a Citizen Communication Device using a Book and Quill and a Redstone Torch (I would really appreciate it if someone could create a better texture for it):
Then left-click on a citizen you want to talk to and something similar to this will show:
Now the citizen will complain if they are unhappy or missing some resources, just talk right away!