preliminary
To integrate ChatGPT into wukong-robot, you first need to obtain an OpenAI API Key. Go to the OpenAI website to request and obtain a valid API Key.
Configuration steps
- Modify the configuration file:
Open the configuration file for wukong-robot~/.wukong/config.yml
inopenai
section to add configurations:openai:
api_key: 'your_openai_api_key'
model: 'gpt-3.5-turbo' - Save the configuration:
Save the file after making sure the configuration is formatted correctly - Restart the service:
Making the new configuration effective
Usage
Once the configuration is complete, wake up wukong-robot and say something like the following:
- "Talk to me about artificial intelligence."
- "Tell a joke."
- "Write a poem about spring."
Security recommendations
To secure the API Key:
- Do not write the API Key directly to the log file
- Set the configuration file permissions to 600
- Change API Key regularly
This answer comes from the articlewukong-robot: a smart speaker project to create personalized Chinese voice conversationsThe