@@ -19,10 +19,15 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
1919 }
2020
2121 override async * createMessage ( systemPrompt : string , messages : Anthropic . Messages . MessageParam [ ] ) : ApiStream {
22- const model = this . client . getGenerativeModel ( {
23- model : this . getModel ( ) . id ,
24- systemInstruction : systemPrompt ,
25- } )
22+ const model = this . client . getGenerativeModel (
23+ {
24+ model : this . getModel ( ) . id ,
25+ systemInstruction : systemPrompt ,
26+ } ,
27+ {
28+ baseUrl : this . options . googleGeminiBaseUrl || undefined ,
29+ } ,
30+ )
2631 const result = await model . generateContentStream ( {
2732 contents : messages . map ( convertAnthropicMessageToGemini ) ,
2833 generationConfig : {
@@ -57,9 +62,14 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
5762
5863 async completePrompt ( prompt : string ) : Promise < string > {
5964 try {
60- const model = this . client . getGenerativeModel ( {
61- model : this . getModel ( ) . id ,
62- } )
65+ const model = this . client . getGenerativeModel (
66+ {
67+ model : this . getModel ( ) . id ,
68+ } ,
69+ {
70+ baseUrl : this . options . googleGeminiBaseUrl || undefined ,
71+ } ,
72+ )
6373
6474 const result = await model . generateContent ( {
6575 contents : [ { role : "user" , parts : [ { text : prompt } ] } ] ,
0 commit comments