添加AI 优化接口
This commit is contained in:
@@ -160,6 +160,21 @@ class ResumeDiagnoseService:
|
||||
issue.user_feedback = user_feedback
|
||||
await self.session.flush()
|
||||
|
||||
async def get_issue_for_polish(self, issue_id: int, user_id: int) -> dict:
|
||||
"""获取 issue 润色所需的上下文信息"""
|
||||
result = await self.session.execute(
|
||||
select(ResumeDiagnosisIssue).where(
|
||||
ResumeDiagnosisIssue.id == issue_id, ResumeDiagnosisIssue.user_id == user_id))
|
||||
issue = result.scalar_one_or_none()
|
||||
if issue is None:
|
||||
raise ValueError("诊断问题不存在")
|
||||
return {
|
||||
"module_type": issue.module_type,
|
||||
"module_label": _MODULE_LABELS.get(issue.module_type, issue.module_type),
|
||||
"optimized_content": issue.optimized_content,
|
||||
"is_summary": issue.module_type == "summary",
|
||||
}
|
||||
|
||||
|
||||
# ===== 工具函数 =====
|
||||
|
||||
|
||||
Reference in New Issue
Block a user