hishtory icon indicating copy to clipboard operation
hishtory copied to clipboard

ai: add some new env variables to control OpenAI requests

Open GRbit opened this issue 1 year ago • 0 comments

Here are some changes/updates to code that handles OpenAI requests.

  • default model changed to gpt-4o-mini cause it's cheaper and better than gpt-3.5-turbo (see models description and pricing)
  • new OPENAI_API_MODEL env variable
  • new OPENAI_API_NUMBER_COMPLETIONS variable
  • new OPENAI_API_SYSTEM_PROMPT variable
  • &http.Client{} in shared/ai replaced with http.DefaultClient. Go http clients are perfectly ready for using from multiple goroutines, there is no need in allocated a new client each time you do http request.

Don't hesitate to change anything, request any changes, or share some suggestions.

GRbit avatar Jul 24 '24 19:07 GRbit