Skip to content

Commit ce5c807

Browse files
committed
Auto-commit
1 parent 4a2734a commit ce5c807

File tree

17 files changed

+594
-270
lines changed

17 files changed

+594
-270
lines changed

internal/config/multi_provider.go

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,41 @@ import (
1010

1111
// MultiProviderConfig represents the full multi-provider configuration
1212
type MultiProviderConfig struct {
13-
Server MultiServerConfig `yaml:"server"`
13+
Server MultiServerConfig `yaml:"server"`
1414
Database DatabaseConfig `yaml:"database"`
1515
Redis RedisConfig `yaml:"redis"`
16-
Providers map[string]*LLMProvider `yaml:"providers"`
16+
Providers map[string]*LLMProvider `yaml:"providers"`
1717
Ensemble *MultiEnsembleConfig `yaml:"ensemble"`
1818
OpenAI *OpenAIConfig `yaml:"openai_compatible"`
1919
MCP *MCPConfig `yaml:"mcp"`
2020
LSP *LSPConfig `yaml:"lsp"`
2121
Memory *MemoryConfig `yaml:"memory"`
2222
Logging *LoggingConfig `yaml:"logging"`
23-
Metrics *MultiMetricsConfig `yaml:"metrics"`
23+
Metrics *MultiMetricsConfig `yaml:"metrics"`
2424
}
2525

2626
// MultiServerConfig holds server configuration
2727
type MultiServerConfig struct {
28-
Host string `yaml:"host"`
29-
Port int `yaml:"port"`
30-
Debug bool `yaml:"debug"`
31-
Timeout time.Duration `yaml:"timeout"`
28+
Host string `yaml:"host"`
29+
Port int `yaml:"port"`
30+
Debug bool `yaml:"debug"`
31+
Timeout time.Duration `yaml:"timeout"`
3232
}
3333

3434
// LLMProvider holds provider-specific configuration
3535
type LLMProvider struct {
36-
Name string `yaml:"name"`
37-
Type string `yaml:"type"`
38-
Enabled bool `yaml:"enabled"`
39-
APIKey string `yaml:"api_key"`
40-
BaseURL string `yaml:"base_url"`
41-
Timeout time.Duration `yaml:"timeout"`
42-
MaxRetries int `yaml:"max_retries"`
43-
Weight float64 `yaml:"weight"`
44-
Tags []string `yaml:"tags"`
45-
Capabilities map[string]string `yaml:"capabilities"`
36+
Name string `yaml:"name"`
37+
Type string `yaml:"type"`
38+
Enabled bool `yaml:"enabled"`
39+
APIKey string `yaml:"api_key"`
40+
BaseURL string `yaml:"base_url"`
41+
Timeout time.Duration `yaml:"timeout"`
42+
MaxRetries int `yaml:"max_retries"`
43+
Weight float64 `yaml:"weight"`
44+
Tags []string `yaml:"tags"`
45+
Capabilities map[string]string `yaml:"capabilities"`
4646
CustomSettings map[string]interface{} `yaml:"custom_settings"`
47-
Models []ModelConfig `yaml:"models"`
47+
Models []ModelConfig `yaml:"models"`
4848
}
4949

5050
// ModelConfig holds model-specific configuration
@@ -59,25 +59,25 @@ type ModelConfig struct {
5959

6060
// MultiEnsembleConfig holds ensemble configuration
6161
type MultiEnsembleConfig struct {
62-
Strategy string `yaml:"strategy"`
63-
MinProviders int `yaml:"min_providers"`
64-
MaxProviders int `yaml:"max_providers"`
65-
ConfidenceThreshold float64 `yaml:"confidence_threshold"`
66-
FallbackToBest bool `yaml:"fallback_to_best"`
67-
Timeout time.Duration `yaml:"timeout"`
68-
PreferredProviders []string `yaml:"preferred_providers"`
69-
ProviderWeights map[string]float64 `yaml:"provider_weights"`
62+
Strategy string `yaml:"strategy"`
63+
MinProviders int `yaml:"min_providers"`
64+
MaxProviders int `yaml:"max_providers"`
65+
ConfidenceThreshold float64 `yaml:"confidence_threshold"`
66+
FallbackToBest bool `yaml:"fallback_to_best"`
67+
Timeout time.Duration `yaml:"timeout"`
68+
PreferredProviders []string `yaml:"preferred_providers"`
69+
ProviderWeights map[string]float64 `yaml:"provider_weights"`
7070
}
7171

7272
// OpenAIConfig holds OpenAI compatibility configuration
7373
type OpenAIConfig struct {
74-
Enabled bool `yaml:"enabled"`
75-
BasePath string `yaml:"base_path"`
76-
ExposeAllModels bool `yaml:"expose_all_models"`
77-
EnsembleModelName string `yaml:"ensemble_model_name"`
78-
EnableStreaming bool `yaml:"enable_streaming"`
79-
EnableFunctions bool `yaml:"enable_functions"`
80-
EnableTools bool `yaml:"enable_tools"`
74+
Enabled bool `yaml:"enabled"`
75+
BasePath string `yaml:"base_path"`
76+
ExposeAllModels bool `yaml:"expose_all_models"`
77+
EnsembleModelName string `yaml:"ensemble_model_name"`
78+
EnableStreaming bool `yaml:"enable_streaming"`
79+
EnableFunctions bool `yaml:"enable_functions"`
80+
EnableTools bool `yaml:"enable_tools"`
8181
}
8282

8383
// MCPConfig holds Model Context Protocol configuration
@@ -89,24 +89,24 @@ type MCPConfig struct {
8989

9090
// LSPConfig holds Language Server Protocol configuration
9191
type LSPConfig struct {
92-
Enabled bool `yaml:"enabled"`
92+
Enabled bool `yaml:"enabled"`
9393
ExposeAllCapabilities bool `yaml:"expose_all_capabilities"`
9494
}
9595

9696
// MemoryConfig holds memory configuration
9797
type MemoryConfig struct {
98-
Enabled bool `yaml:"enabled"`
99-
Provider string `yaml:"provider"`
98+
Enabled bool `yaml:"enabled"`
99+
Provider string `yaml:"provider"`
100100
MaxContextLength int `yaml:"max_context_length"`
101-
RetentionDays int `yaml:"retention_days"`
101+
RetentionDays int `yaml:"retention_days"`
102102
}
103103

104104
// LoggingConfig holds logging configuration
105105
type LoggingConfig struct {
106-
Level string `yaml:"level"`
107-
Format string `yaml:"format"`
108-
EnableRequestLogging bool `yaml:"enable_request_logging"`
109-
EnableResponseLogging bool `yaml:"enable_response_logging"`
106+
Level string `yaml:"level"`
107+
Format string `yaml:"format"`
108+
EnableRequestLogging bool `yaml:"enable_request_logging"`
109+
EnableResponseLogging bool `yaml:"enable_response_logging"`
110110
}
111111

112112
// MetricsConfig holds metrics configuration
@@ -117,7 +117,7 @@ type MetricsConfig struct {
117117

118118
// MultiMetricsConfig holds metrics configuration
119119
type MultiMetricsConfig struct {
120-
Enabled bool `yaml:"enabled"`
120+
Enabled bool `yaml:"enabled"`
121121
Prometheus *MultiPrometheusConfig `yaml:"prometheus"`
122122
}
123123

@@ -158,7 +158,7 @@ func substituteEnvVars(config *MultiProviderConfig) error {
158158
if provider.BaseURL != "" {
159159
provider.BaseURL = os.ExpandEnv(provider.BaseURL)
160160
}
161-
161+
162162
// Substitute model-specific custom parameters
163163
for i := range provider.Models {
164164
for key, value := range provider.Models[i].CustomParams {
@@ -167,7 +167,7 @@ func substituteEnvVars(config *MultiProviderConfig) error {
167167
}
168168
}
169169
}
170-
170+
171171
config.Providers[name] = provider
172172
}
173173

@@ -176,9 +176,9 @@ func substituteEnvVars(config *MultiProviderConfig) error {
176176
config.Database.User = os.ExpandEnv(config.Database.User)
177177
config.Database.Password = os.ExpandEnv(config.Database.Password)
178178
config.Database.Name = os.ExpandEnv(config.Database.Name)
179-
179+
180180
config.Redis.Host = os.ExpandEnv(config.Redis.Host)
181181
config.Redis.Password = os.ExpandEnv(config.Redis.Password)
182182

183183
return nil
184-
}
184+
}

0 commit comments

Comments
 (0)