Add Azure Anthropic support

This commit is contained in:
2026-03-01 19:00:03 +00:00
parent 88fe79e457
commit b5f21f385a
4 changed files with 57 additions and 6 deletions

View File

@@ -28,10 +28,18 @@ type ServerConfig struct {
// ProvidersConfig wraps supported provider settings.
type ProvidersConfig struct {
Google ProviderConfig `yaml:"google"`
Anthropic ProviderConfig `yaml:"anthropic"`
OpenAI ProviderConfig `yaml:"openai"`
AzureOpenAI AzureOpenAIConfig `yaml:"azureopenai"`
Google ProviderConfig `yaml:"google"`
Anthropic ProviderConfig `yaml:"anthropic"`
OpenAI ProviderConfig `yaml:"openai"`
AzureOpenAI AzureOpenAIConfig `yaml:"azureopenai"`
AzureAnthropic AzureAnthropicConfig `yaml:"azureanthropic"`
}
// AzureAnthropicConfig contains Azure-specific settings for Anthropic (Microsoft Foundry).
type AzureAnthropicConfig struct {
APIKey string `yaml:"api_key"`
Endpoint string `yaml:"endpoint"`
Model string `yaml:"model"`
}
// ProviderConfig contains shared provider configuration fields.
@@ -83,6 +91,17 @@ func (cfg *Config) applyEnvOverrides() {
if v := os.Getenv("AZURE_OPENAI_API_VERSION"); v != "" {
cfg.Providers.AzureOpenAI.APIVersion = v
}
// Azure Anthropic (Microsoft Foundry) overrides
if v := os.Getenv("AZURE_ANTHROPIC_API_KEY"); v != "" {
cfg.Providers.AzureAnthropic.APIKey = v
}
if v := os.Getenv("AZURE_ANTHROPIC_ENDPOINT"); v != "" {
cfg.Providers.AzureAnthropic.Endpoint = v
}
if v := os.Getenv("AZURE_ANTHROPIC_MODEL"); v != "" {
cfg.Providers.AzureAnthropic.Model = v
}
}
func overrideAPIKey(cfg *ProviderConfig, envKey string) {