feat: 添加LLM配置
This commit is contained in:
@@ -25,3 +25,4 @@ go.work.sum
|
||||
# env file
|
||||
.env
|
||||
|
||||
.vscode/
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user