From 8cb77d38c13df4348f9c5e21f6c1054d4df0c74e Mon Sep 17 00:00:00 2001 From: hhs <386998068.com> Date: Sun, 19 Apr 2026 14:43:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0LLM=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + backend/internal/config/config.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index 5b90e79..66d8d94 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ go.work.sum # env file .env +.vscode/ \ No newline at end of file diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index febe05a..4df148f 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -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