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