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 file
.env .env
.vscode/
+14
View File
@@ -32,11 +32,19 @@ type CORSConfig struct {
MaxAge time.Duration MaxAge time.Duration
} }
type LLMConfig struct {
Provider string
APIKey string
Model string
BaseURL string
}
type Config struct { type Config struct {
Server ServerConfig Server ServerConfig
Neo4j Neo4jConfig Neo4j Neo4jConfig
Data DataConfig Data DataConfig
CORS CORSConfig CORS CORSConfig
LLM LLMConfig
} }
func Load() (*Config, error) { func Load() (*Config, error) {
@@ -67,6 +75,12 @@ func Load() (*Config, error) {
AllowCredentials: true, AllowCredentials: true,
MaxAge: 12 * time.Hour, 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 return cfg, nil