on main help sign in
feat(config): allow custom providers of type gemini (#585)
6b161d2kslamph
internal/config/load.go+1−1
@@ -270,7 +270,7 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know
270 c.Providers.Del(id)
270 c.Providers.Del(id)
271 continue
271 continue
272 }
272 }
273− if providerConfig.Type != catwalk.TypeOpenAI && providerConfig.Type != catwalk.TypeAnthropic {
273+ if providerConfig.Type != catwalk.TypeOpenAI && providerConfig.Type != catwalk.TypeAnthropic && providerConfig.Type != catwalk.TypeGemini {
274 slog.Warn("Skipping custom provider because the provider type is not supported", "provider", id, "type", providerConfig.Type)
274 slog.Warn("Skipping custom provider because the provider type is not supported", "provider", id, "type", providerConfig.Type)
275 c.Providers.Del(id)
275 c.Providers.Del(id)
276 continue
276 continue
internal/llm/provider/gemini.go+3
@@ -43,6 +43,9 @@ func createGeminiClient(opts providerClientOptions) (*genai.Client, error) {
43 cc := &genai.ClientConfig{
43 cc := &genai.ClientConfig{
44 APIKey: opts.apiKey,
44 APIKey: opts.apiKey,
45 Backend: genai.BackendGeminiAPI,
45 Backend: genai.BackendGeminiAPI,
46+ HTTPOptions: genai.HTTPOptions{
47+ BaseURL: opts.baseURL,
48+ },
46 }
49 }
47 if config.Get().Options.Debug {
50 if config.Get().Options.Debug {
48 cc.HTTPClient = log.NewHTTPClient()
51 cc.HTTPClient = log.NewHTTPClient()