feat: jev 接入,判断创建、修改、问答、不明确四类意图

This commit is contained in:
2026-09-22 20:14:10 +08:00
parent 94faffca18
commit 417772b007
7 changed files with 346 additions and 17 deletions
+24
View File
@@ -0,0 +1,24 @@
"""需求节点的意图判断定义"""
from app.schemas.decision import ChoiceDecision
def build_intent_question() -> ChoiceDecision:
return ChoiceDecision(
# 判断主要意图;只有明确要求实际编辑时才判断为修改,不能仅根据选中节点判断
instructions=(
"Classify the user's primary intent. "
"Choose modify_screen only when the user explicitly requests an actual edit. "
"Do not infer editing solely from selected nodes."
),
criteria={
# 创建新的大屏
"create_screen": "Create a new screen",
# 明确要求修改、增加、删除或重新设计已有大屏
"modify_screen": "Explicitly request modifying, adding, deleting, or redesigning an existing screen",
# 询问知识、原因、建议或如何修改,但没有要求实际执行
"qa": "Ask for information, reasons, suggestions, or how to improve something without requesting an actual edit",
# 无法判断意图或不属于上述类型
"unclear": "Intent is unclear or outside the above categories",
},
)