29 lines
1.9 KiB
Python
29 lines
1.9 KiB
Python
"""意图节点的判断定义"""
|
|
|
|
from app.schemas.decision import ChoiceDecision
|
|
|
|
|
|
def build_intent_question() -> ChoiceDecision:
|
|
return ChoiceDecision(
|
|
# 区分意图模糊与修改细节缺失,后者交给需求理解
|
|
instructions=(
|
|
"Classify the user's primary intent. "
|
|
"Read `prompt` together with `clarification_history`; later answers clarify or correct earlier requests. "
|
|
"Choose modify_screen only when the user explicitly requests an actual edit. "
|
|
"Choose qa only for an explicit request for information, explanation, diagnosis, or advice. "
|
|
"A vague complaint or evaluation without a requested next step is unclear, not automatically qa. "
|
|
"An explicit edit request remains modify_screen even when edit details are missing. "
|
|
"Do not infer intent solely from selected nodes or an empty screen."
|
|
),
|
|
criteria={
|
|
# 创建新的大屏
|
|
"create_screen": "Create a new screen",
|
|
# 明确要求修改、增加、删除或重新设计已有大屏
|
|
"modify_screen": "Explicitly request modifying, adding, deleting, or redesigning an existing screen, including requests lacking details such as 帮我修改这个图",
|
|
# 询问知识、原因、建议或如何修改,但没有要求实际执行
|
|
"qa": "Explicitly ask for information, reasons, diagnosis, or suggestions without requesting an actual edit, e.g. 这个图为什么没有数据 or 这个图怎么优化",
|
|
# 语义上没有明确表达要问什么或做什么,不等同于模型分数低
|
|
"unclear": "The requested intent is not expressed clearly: vague feedback, references, or an unspecified request to look, e.g. 这个图不太对, 这个有点问题, 帮我看看这个; no explicit question or edit request",
|
|
},
|
|
)
|