diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index 311fd3eb..00000000 --- a/config/config.yaml +++ /dev/null @@ -1,33 +0,0 @@ -server: - port: "${PORT:-8080}" - -providers: - openai-primary: - type: "openai" - api_key: "${OPENAI_API_KEY}" - - anthropic-primary: - type: "anthropic" - api_key: "${ANTHROPIC_API_KEY}" - - gemini-primary: - type: "gemini" - api_key: "${GEMINI_API_KEY}" - - # Example: Groq (OpenAI-compatible) - # groq: - # type: "openai" - # base_url: "https://api.groq.com/openai/v1" - # api_key: "${GROQ_API_KEY}" - - # Example: Azure OpenAI - # azure-openai: - # type: "openai" - # base_url: "https://your-resource.openai.azure.com/openai/deployments/your-deployment" - # api_key: "${AZURE_OPENAI_API_KEY}" - - # Example: DeepSeek (OpenAI-compatible) - # deepseek: - # type: "openai" - # base_url: "https://api.deepseek.com/v1" - # api_key: "${DEEPSEEK_API_KEY}" diff --git a/internal/providers/anthropic/anthropic.go b/internal/providers/anthropic/anthropic.go index 3823baf6..1c76f9ee 100644 --- a/internal/providers/anthropic/anthropic.go +++ b/internal/providers/anthropic/anthropic.go @@ -29,7 +29,7 @@ func init() { p := New(cfg.APIKey) // Override base URL if provided in config if cfg.BaseURL != "" { - p.baseURL = cfg.BaseURL + p.SetBaseURL(cfg.BaseURL) } return p, nil }) @@ -60,6 +60,11 @@ func NewWithHTTPClient(apiKey string, client *http.Client) *Provider { } } +// SetBaseURL allows configuring a custom base URL for the provider +func (p *Provider) SetBaseURL(url string) { + p.baseURL = url +} + // Supports returns true if this provider can handle the given model func (p *Provider) Supports(model string) bool { return strings.HasPrefix(model, "claude-") diff --git a/internal/providers/gemini/gemini.go b/internal/providers/gemini/gemini.go index d76abf5c..cf971aaa 100644 --- a/internal/providers/gemini/gemini.go +++ b/internal/providers/gemini/gemini.go @@ -29,7 +29,7 @@ func init() { p := New(cfg.APIKey) // Override base URL if provided in config if cfg.BaseURL != "" { - p.baseURL = cfg.BaseURL + p.SetBaseURL(cfg.BaseURL) } return p, nil }) @@ -63,6 +63,11 @@ func NewWithHTTPClient(apiKey string, client *http.Client) *Provider { } } +// SetBaseURL allows configuring a custom base URL for the provider +func (p *Provider) SetBaseURL(url string) { + p.baseURL = url +} + // Supports returns true if this provider can handle the given model func (p *Provider) Supports(model string) bool { return strings.HasPrefix(model, "gemini-") diff --git a/internal/providers/openai/openai.go b/internal/providers/openai/openai.go index 6674e57f..bba6c2d9 100644 --- a/internal/providers/openai/openai.go +++ b/internal/providers/openai/openai.go @@ -25,7 +25,7 @@ func init() { p := New(cfg.APIKey) // Override base URL if provided in config if cfg.BaseURL != "" { - p.baseURL = cfg.BaseURL + p.SetBaseURL(cfg.BaseURL) } return p, nil }) @@ -56,6 +56,11 @@ func NewWithHTTPClient(apiKey string, client *http.Client) *Provider { } } +// SetBaseURL allows configuring a custom base URL for the provider +func (p *Provider) SetBaseURL(url string) { + p.baseURL = url +} + // Supports returns true if this provider can handle the given model func (p *Provider) Supports(model string) bool { return strings.HasPrefix(model, "gpt-") || strings.HasPrefix(model, "o1")