From 98b75a732ce46e61949b7d1901e10baa9d55ccf1 Mon Sep 17 00:00:00 2001 From: songsenand Date: Fri, 23 Jan 2026 21:09:29 +0800 Subject: [PATCH] 20260123 --- autocommit/config.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/autocommit/config.py b/autocommit/config.py index 17442cd..8f05727 100644 --- a/autocommit/config.py +++ b/autocommit/config.py @@ -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): """应用配置"""