Updated openai base url
Some providers don't expect `/v1/chat/completions` but instead `/v1/openai/chat/completions`
This commit is contained in:
@@ -225,7 +225,7 @@ func (c *Context) GetModelProvider(model string, provider string) (*ModelConfig,
|
|||||||
}
|
}
|
||||||
return c.fillModelConfig(cfg, m), nil
|
return c.fillModelConfig(cfg, m), nil
|
||||||
case "openai":
|
case "openai":
|
||||||
url := "https://api.openai.com"
|
url := "https://api.openai.com/v1"
|
||||||
if p.BaseURL != "" {
|
if p.BaseURL != "" {
|
||||||
url = p.BaseURL
|
url = p.BaseURL
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ func (c *OpenAIClient) sendRequest(ctx context.Context, r ChatCompletionRequest)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req, err := http.NewRequestWithContext(ctx, "POST", c.BaseURL+"/v1/chat/completions", bytes.NewBuffer(jsonData))
|
req, err := http.NewRequestWithContext(ctx, "POST", c.BaseURL+"/chat/completions", bytes.NewBuffer(jsonData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user