@@ -35,7 +35,7 @@ func NewOpenAIAdapter(endpoint *provider.EndpointConfig, apiKey, model, lang str
|
||||
if endpoint != nil && endpoint.BaseURL != "" {
|
||||
// use custom endpoint
|
||||
clientConfig := openai.DefaultConfig(apiKey)
|
||||
clientConfig.BaseURL = endpoint.BaseURL + "/v1"
|
||||
clientConfig.BaseURL = strings.TrimRight(endpoint.BaseURL, "/") + "/v1"
|
||||
client = openai.NewClientWithConfig(clientConfig)
|
||||
} else {
|
||||
// default to OpenAI
|
||||
|
||||
Reference in New Issue
Block a user