From eb6873c32938eb7cc9c2f390198fb6c9067d6055 Mon Sep 17 00:00:00 2001 From: zhangzhanwei Date: Fri, 19 Sep 2025 17:52:58 +0800 Subject: [PATCH] fix: Improve intent node MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1062028 --user=张展玮 【应用编排】意图识别节点没有带上历史聊天记录进行分类 https://www.tapd.cn/62980211/s/1776831 --- .../intent_node/impl/prompt_template.py | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/apps/application/flow/step_node/intent_node/impl/prompt_template.py b/apps/application/flow/step_node/intent_node/impl/prompt_template.py index cf0dff566..d48b03304 100644 --- a/apps/application/flow/step_node/intent_node/impl/prompt_template.py +++ b/apps/application/flow/step_node/intent_node/impl/prompt_template.py @@ -2,29 +2,31 @@ -PROMPT_TEMPLATE = """# Role - You are an intention classification expert, good at being able to judge which classification the user's input belongs to. +PROMPT_TEMPLATE = """ + # Role + You are an intention classification expert, good at being able to judge which classification the user's input belongs to. - ## Skills - Skill 1: Clearly determine which of the following intention classifications the user's input belongs to. - Intention classification list: - {classification_list} + ## Skills + Skill 1: Clearly determine which of the following intention classifications the user's input belongs to. + Intention classification list: + {classification_list} - Note: - - Please determine the match only between the user's input content and the Intention classification list content, without judging or categorizing the match with the classification ID. + Note: + - Please determine the match only between the user's input content and the Intention classification list content, without judging or categorizing the match with the classification ID. + - **When classifying, you must give higher weight to the context and intent continuity shown in the historical conversation. Do not rely solely on the literal meaning of the current input; instead, prioritize the most consistent classification with the previous dialogue flow.** - ## User Input - {user_input} + ## User Input + {user_input} - ## Reply requirements - - The answer must be returned in JSON format. - - Strictly ensure that the output is in a valid JSON format. - - Do not add prefix ```json or suffix ``` - - The answer needs to include the following fields such as: - {{ - "classificationId": 0, - "reason": "" - }} + ## Reply requirements + - The answer must be returned in JSON format. + - Strictly ensure that the output is in a valid JSON format. + - Do not add prefix ```json or suffix ``` + - The answer needs to include the following fields such as: + {{ + "classificationId": 0, + "reason": "" + }} - ## Limit - - Please do not reply in text.""" \ No newline at end of file + ## Limit + - Please do not reply in text."""