on main help sign in
fix(gemini): add baseURL resolution and conditional HTTPOptions configuration (#1144)
commitbaf053409d1f4945513ab77ff8772c3abe150985 authordaniel <15257433+kslamph@users.noreply.github.com> dateSun 28 Sep 2025, 21:18 (1 year ago) parent42a4159
1 file changed+9−4
internal/llm/provider/gemini.go+9−4
internal/llm/provider/gemini.go+9−4
@@ -43,9 +43,14 @@ func createGeminiClient(opts providerClientOptions) (*genai.Client, error) {
4343 cc := &genai.ClientConfig{
4444 APIKey: opts.apiKey,
4545 Backend: genai.BackendGeminiAPI,
46− HTTPOptions: genai.HTTPOptions{
47− BaseURL: opts.baseURL,
48− },
46+ }
47+ if opts.baseURL != "" {
48+ resolvedBaseURL, err := config.Get().Resolve(opts.baseURL)
49+ if err == nil && resolvedBaseURL != "" {
50+ cc.HTTPOptions = genai.HTTPOptions{
51+ BaseURL: resolvedBaseURL,
52+ }
53+ }
4954 }
5055 if config.Get().Options.Debug {
5156 cc.HTTPClient = log.NewHTTPClient()
@@ -572,4 +577,4 @@ func contains(s string, substrs ...string) bool {
572577 }
573578 }
574579 return false
575−}
580+}