triage/agent_system/triager/response_model.py
iomgaa f47d56051b 新增:添加Triager科室分诊智能体模块
- 实现TriageAgent智能体,支持根据现病史、既往史和主诉进行科室分诊
- 添加TriageResult响应模型,包含一级科室、二级科室、信心度和推理过程
- 创建TriagerPrompt提示词模板,包含完整的科室体系和分诊逻辑
- 支持13个一级科室和对应的二级科室精确匹配
- 通过测试验证,能够准确分诊心血管、儿科、脊柱外科等不同类型疾病
- 提供便捷接口支持仅主诉分诊和信心度评价功能

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 17:30:23 +08:00

34 lines
944 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from typing import Literal
from pydantic import Field
from agent_system.base import BaseResponseModel
class TriageResult(BaseResponseModel):
"""
科室分诊结果模型
"""
primary_department: Literal[
"内科", "外科", "儿科", "妇产科", "皮肤性病科",
"口腔科", "眼科", "肿瘤科", "耳鼻咽喉科", "康复科",
"精神科", "全科", "体检科"
] = Field(
...,
description="一级科室,必须从指定的科室列表中选择"
)
secondary_department: str = Field(
...,
description="二级科室,必须是一级科室的下属科室"
)
confidence_score: float = Field(
...,
ge=0.0,
le=1.0,
description="分诊信心度评分0-1之间"
)
triage_reasoning: str = Field(
...,
description="分诊推理过程,解释为什么推荐该科室"
)