Connecting the OpenAI API with GPTTalk Plugin

Connecting the OpenAI API with the GPTTalk plugin allows you to infuse the chat functionality with powerful AI capabilities. Follow the step-by-step guide below to set up the integration:

Obtain OpenAI API Key

  • Visit the OpenAI platform at this link.

  • Create an account or log in if you already have one.

  • Generate your unique API key. This will be used to authenticate your plugin's requests with OpenAI.

2. Configure the config.yml:

  • Open the config.yml file for the GPTTalk plugin.

  • Locate the openai section and find the following settings:

openai:
  # The OpenAI API key, paste your unique key here.
  api-key: "YOUR_API_KEY_HERE"
  
  # Determines how "creative" the AI will be; higher values result in more creative responses.
  temperature: 0.7
  
  # Sets the maximum token limit for the AI's response; higher values allow for longer responses.
  max-tokens: 150
  
  # Chooses between completion (short responses) and chat (longer conversations) modes.
  chat-mode: chat
  
  # Specifies the model to use, which must match the chat mode selected.
  model: "gpt-3.5-turbo-16k"

Replace YOUR_API_KEY_HERE with the API key you obtained from OpenAI.

Configuration Explanation:

  • api-key: Place your unique OpenAI API key here.

  • temperature: Controls the "creativity" of the AI's response (0.0 to 1.0).

  • max-tokens: Defines the length of the AI's response by setting a maximum token limit.

  • chat-mode: Determines the chat mode (completion or chat) for different types of interactions.

  • model: Sets the specific model to be used by the AI, must align with the chosen chat mode.

By following this guide, you'll have connected the OpenAI API with the GPTTalk plugin, and you're ready to provide engaging and intelligent NPC interactions on your server! If you encounter any issues or need further assistance, consult the GPTTalk Wiki or seek support from the community.

Last updated