chore: update go-openai dependency to v1.36.1 and improve OpenAI client configuration in headmasterHandler
This commit is contained in:
@@ -46,7 +46,10 @@ func headmasterHandler(msg model.Message) (reply model.Reply) {
|
||||
}
|
||||
|
||||
func ask(from string, question string) (reply string) {
|
||||
client := openai.NewClientWithConfig(openai.DefaultAzureConfig(config.ConfigManager.GetProperty("openai_api_key"), config.ConfigManager.GetProperty("openai_api_base_url")))
|
||||
llmConfig := openai.DefaultAzureConfig(config.ConfigManager.GetProperty("openai_api_key"), config.ConfigManager.GetProperty("openai_api_base_url"))
|
||||
llmConfig.APIType = openai.APITypeOpenAI
|
||||
llmConfig.APIVersion = ""
|
||||
client := openai.NewClientWithConfig(llmConfig)
|
||||
resp, err := client.CreateChatCompletion(
|
||||
context.Background(),
|
||||
openai.ChatCompletionRequest{
|
||||
|
||||
Reference in New Issue
Block a user