hishtory
hishtory copied to clipboard
ai: add some new env variables to control OpenAI requests
Here are some changes/updates to code that handles OpenAI requests.
- default model changed to
gpt-4o-minicause it's cheaper and better thangpt-3.5-turbo(see models description and pricing) - new
OPENAI_API_MODELenv variable - new
OPENAI_API_NUMBER_COMPLETIONSvariable - new
OPENAI_API_SYSTEM_PROMPTvariable &http.Client{}inshared/aireplaced withhttp.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.