diff --git a/.env b/.env index d94861b..2542dcb 100644 --- a/.env +++ b/.env @@ -15,4 +15,6 @@ DB_PASS=postgres DB_NAME=peter # LLM配置 -LLM_API_KEY=sk-88d6437a6c224ccbb761ec7d994e3b34 \ No newline at end of file +LLM_API_KEY=sk-c334321367e843e58faf39956fbb7304 +LLM_MODEL=deepseek-v3.2 +LLM_MAX_TOKENS=4096 \ No newline at end of file diff --git a/config/settings.py b/config/settings.py index 551b981..3d6e8d1 100644 --- a/config/settings.py +++ b/config/settings.py @@ -24,6 +24,8 @@ class Settings(BaseSettings): # LLM配置 LLM_API_KEY: str = Field("LLM_API_KEY") + LLM_MODEL: str = Field("LLM_MODEL", default="deepseek-v3.2") + LLM_MAX_TOKENS: int = Field("LLM_MAX_TOKENS", default=2048) class Config: env_file = ".env" diff --git a/llm/llm_thinking_engine.py b/llm/llm_thinking_engine.py index 0f87658..5b7a7a1 100644 --- a/llm/llm_thinking_engine.py +++ b/llm/llm_thinking_engine.py @@ -1,7 +1,7 @@ from typing import Optional, Dict from dataclasses import dataclass import os -from config.settings import settings +from config import settings from openai import OpenAI from utils import logger @@ -11,10 +11,10 @@ class LLMConfig: """LLM配置类""" api_key: Optional[str] = None base_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1" - model: str = "qwen3.5-plus" + model: str = settings.LLM_MODEL enable_thinking: bool = True temperature: float = 0.7 - max_tokens: int = 4096 + max_tokens: int = settings.LLM_MAX_TOKENS class LLMThinkingEngine: