diff --git a/src/core/llm/gemini.ts b/src/core/llm/gemini.ts index 26c54335..b0ba9dc8 100644 --- a/src/core/llm/gemini.ts +++ b/src/core/llm/gemini.ts @@ -49,11 +49,13 @@ export class GeminiProvider extends BaseLLMProvider< constructor(provider: Extract) { super(provider) - if (provider.baseUrl) { - throw new Error('Gemini does not support custom base URL') - } - this.client = new GoogleGenAI({ apiKey: provider.apiKey ?? '' }) + this.client = new GoogleGenAI({ + apiKey: provider.apiKey ?? '', + httpOptions: provider.baseUrl + ? { baseUrl: provider.baseUrl.replace(/\/+$/, '') } + : undefined, + }) this.apiKey = provider.apiKey ?? '' }