This commit is contained in:
songsenand 2026-01-23 21:09:29 +08:00
parent afdb60e8ef
commit 98b75a732c
1 changed files with 15 additions and 2 deletions

View File

@ -6,14 +6,27 @@ from pydantic import BaseModel, Field
import yaml
import json
SYSTEM_PROMPT = """
你是一个专业开发者请根据以下 git diff 生成一条符合 Conventional Commits 规范的中文 commit message
要求50字以内不要解释不要引号只输出 message 本身\n
diff:\n"
"""
class LLMConfig(BaseModel):
"""LLM配置模型"""
api_key: Optional[str] = Field(None, description="LLM API密钥")
base_url: str = Field("https://api.openai.com/v1", description="API基础URL")
model: str = Field("gpt-3.5-turbo", description="模型名称")
base_url: str = Field("https://dashscope.aliyuncs.com/compatible-mode/v1", description="API基础URL")
model: str = Field("qwen3-14b", description="模型名称")
timeout: int = Field(30, description="请求超时时间(秒)")
max_tokens: int = Field(1000, description="最大生成token数")
temperature: float = Field(0.7, description="温度参数")
extra_body: Dict = field(default_factory=lambda: {"enable_thinking": False})
response_format: bool = field(default_factory=lambda: {"type": "json_object"})
system_prompt: str = SYSTEM_PROMPT
# stream_output: bool = False
class AppConfig(BaseModel):
"""应用配置"""