modulepackage
0.0.0-20240529205039-df0a86b32ede
Repository: https://github.com/aldarisbm/openai.git
Documentation: pkg.go.dev
# README
Cleo
Conversational Language Engine Optimized
chatbot in your terminal
Binary in go to use the openai api to create a chatbot in your terminal
Function: New()
The New()
returns a new Chatbot
Loading environment variables
The function first attempts to load environment variables from a .env
file using the godotenv
package. If the file cannot be loaded, the script will log a fatal error and exit. The expected environment variables are:
TOKEN
: The OpenAI API tokenSYSTEM_PROMPT
: The prompt to be used for the systemMAX_PRIOR_MESSAGES
: The maximum number of prior messages to be considered for context
User input
If the TOKEN
environment variable is not provided, the function prompts the user to enter it manually.
Usage
just build it and run it, use the .env.example to create your own .env file with your openai token
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
ChatBot represents a chatbot.
ChatContext represents a chat context.
No description provided by the author