mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 00:04:49 +00:00
Merge pull request #251 from shellfyred/fix/gemini-baseurl-double-path
fix(ai): prevent double API version path in Google provider URL
This commit is contained in:
commit
c712901eb2
1 changed files with 2 additions and 1 deletions
|
|
@ -266,9 +266,10 @@ function createClient(model: Model<"google-generative-ai">, apiKey?: string): Go
|
||||||
apiKey = process.env.GEMINI_API_KEY;
|
apiKey = process.env.GEMINI_API_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
const httpOptions: { baseUrl?: string; headers?: Record<string, string> } = {};
|
const httpOptions: { baseUrl?: string; apiVersion?: string; headers?: Record<string, string> } = {};
|
||||||
if (model.baseUrl) {
|
if (model.baseUrl) {
|
||||||
httpOptions.baseUrl = model.baseUrl;
|
httpOptions.baseUrl = model.baseUrl;
|
||||||
|
httpOptions.apiVersion = ""; // baseUrl already includes version path, don't append
|
||||||
}
|
}
|
||||||
if (model.headers) {
|
if (model.headers) {
|
||||||
httpOptions.headers = model.headers;
|
httpOptions.headers = model.headers;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue