添加引导词和投递模板

This commit is contained in:
2026-08-26 16:19:15 +08:00
parent ab79dd89be
commit 8d57c5dbc3
17 changed files with 644 additions and 13 deletions
+3 -1
View File
@@ -37,7 +37,7 @@ class AIClient:
# ------------------------------------------------------------------
# 职位匹配度评分
# ------------------------------------------------------------------
def score_job(self, jd_text: str, resume_content: str) -> MatchResult:
def score_job(self, jd_text: str, resume_content: str, prompt: str | None = None) -> MatchResult:
"""根据 JD 与主简历内容评估匹配度"""
if not self.available():
return MatchResult(50, "AI 未配置,默认放行")
@@ -49,6 +49,8 @@ class AIClient:
"评分标准:80-100 高度匹配;60-79 基本匹配;40-59 部分匹配;0-39 不匹配。"
)
user_prompt = f"【职位描述】\n{jd_text}\n\n【候选人简历】\n{resume_content}"
if prompt:
user_prompt += f"\n\n【用户额外偏好/引导词】\n{prompt}"
try:
resp = self.client.chat.completions.create(