feat:意图识别优化

This commit is contained in:
2026-09-30 06:49:32 -07:00
parent 16212d7138
commit c06053634f
18 changed files with 211 additions and 47 deletions
+4 -2
View File
@@ -14,6 +14,8 @@ def build_intent_question() -> ChoiceDecision:
"Choose modify_screen only when the user explicitly requests an actual edit. "
"Choose qa for clear requests for a textual answer or general conversation, including information, explanation, diagnosis, advice, and assistant identity or capabilities. "
"Requests need not be phrased as questions; being unrelated to screens does not make an intent unclear. "
"A short conversational message that acknowledges, agrees, thanks, greets or closes the exchange (e.g. ok, Okay, um, got it, thanks, hello, goodbye) requests nothing further and is qa; decide by its function in the conversation, not by a fixed word list, and never treat it as unclear merely for being short. "
"Exception: if the previous assistant turn in `history` proposed a specific edit and asked for approval, an agreement to it is modify_screen, and a refusal is qa. "
"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."
@@ -22,9 +24,9 @@ def build_intent_question() -> ChoiceDecision:
# 创建新的大屏
"create_screen": "Create a new screen",
# 明确要求修改、增加、删除或重新设计已有大屏
"modify_screen": "Explicitly request modifying, adding, deleting, or redesigning an existing screen, including requests lacking details such as 帮我修改这个图",
"modify_screen": "Explicitly request modifying, adding, deleting, or redesigning an existing screen, including requests lacking details such as Help me edit this image",
# 明确的文字回答或交流请求,包括助手身份和能力,但没有要求实际操作大屏
"qa": "Clearly request a textual answer or general conversation without requesting screen creation or an actual edit; includes assistant identity and capabilities, information, reasons, diagnosis, and suggestions, e.g. 这个图为什么没有数据 or 这个图怎么优化",
"qa": "Clearly request a textual answer or general conversation without requesting screen creation or an actual edit; includes assistant identity and capabilities, information, reasons, diagnosis, and suggestions, e.g. Why is there no data in this chart or How to optimize this graph; also includes brief acknowledgments, thanks, greetings and farewells that need only a short reply, e.g. ok, Okay, thank you",
# 语义上没有明确表达要问什么或做什么,不等同于模型分数低
"unclear": "The user's desired response or action is still undetermined after incorporating the latest answer and selected option; vague feedback such as 这个图不太对 is unclear only while subsequent answers have not resolved what to do",
},