统一抽象 封装 模型配置配置管理
This commit is contained in:
@@ -5,7 +5,7 @@ import asyncio
|
||||
from langchain_core.output_parsers import StrOutputParser
|
||||
from langchain_core.prompts import ChatPromptTemplate
|
||||
|
||||
from app.ai.models import LLM
|
||||
from app.ai.model_config import DiagnoserModel
|
||||
from app.ai.resume_diagnoser.prompts import DIAGNOSE_MODULE_PROMPT, SUMMARY_PROMPT, POLISH_PROMPT
|
||||
from app.core.logger import log
|
||||
from app.tool.json_helper import parse_llm_json
|
||||
@@ -14,14 +14,14 @@ from app.tool.json_helper import parse_llm_json
|
||||
# 诊断链(StrOutputParser 拿原始文本,再手动解析 JSON,避免 markdown 代码块导致解析失败)
|
||||
_diagnose_chain = (
|
||||
ChatPromptTemplate.from_messages([("system", DIAGNOSE_MODULE_PROMPT), ("human", "请开始诊断。")])
|
||||
| LLM.ZM_GPT_5_4_MINI.create(temperature=0)
|
||||
| DiagnoserModel.MODULE
|
||||
| StrOutputParser()
|
||||
)
|
||||
|
||||
# 汇总评价链(纯文本输出)
|
||||
_summary_chain = (
|
||||
ChatPromptTemplate.from_messages([("system", SUMMARY_PROMPT), ("human", "请生成整体评价。")])
|
||||
| LLM.ZM_GPT_5_4_MINI.create(temperature=0.3)
|
||||
| DiagnoserModel.SUMMARY
|
||||
| StrOutputParser()
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ async def generate_summary(grade: str, urgent_total: int, important_total: int,
|
||||
|
||||
_polish_chain = (
|
||||
ChatPromptTemplate.from_messages([("system", POLISH_PROMPT), ("human", "请开始优化。")])
|
||||
| LLM.JIAYU_CLAUDE_SONNET_4_5.create(temperature=0.3)
|
||||
| DiagnoserModel.POLISH
|
||||
| StrOutputParser()
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user