feat: 添加LLM配置

This commit is contained in:
hhs
2026-04-19 14:43:15 +08:00
parent 710888dcfe
commit 8cb77d38c1
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -25,3 +25,4 @@ go.work.sum
# env file
.env
.vscode/
+14
View File
@@ -32,11 +32,19 @@ type CORSConfig struct {
MaxAge time.Duration
}
type LLMConfig struct {
Provider string
APIKey string
Model string
BaseURL string
}
type Config struct {
Server ServerConfig
Neo4j Neo4jConfig
Data DataConfig
CORS CORSConfig
LLM LLMConfig
}
func Load() (*Config, error) {
@@ -67,6 +75,12 @@ func Load() (*Config, error) {
AllowCredentials: true,
MaxAge: 12 * time.Hour,
},
LLM: LLMConfig{
Provider: os.Getenv("PROVIDER"),
APIKey: os.Getenv("API_KEY"),
Model: os.Getenv("MODEL"),
BaseURL: os.Getenv("BASE_URL"),
},
}
return cfg, nil