Skip to content

Commit 35ca7d7

Browse files
committed
fix: Improve intent node
--bug=1062028 --user=张展玮 【应用编排】意图识别节点没有带上历史聊天记录进行分类 https://www.tapd.cn/62980211/s/1776831
1 parent 6a01457 commit 35ca7d7

File tree

1 file changed

+28
-26
lines changed

1 file changed

+28
-26
lines changed

apps/application/flow/step_node/intent_node/impl/prompt_template.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22

33

44

5-
PROMPT_TEMPLATE = """# Role
6-
You are an intention classification expert, good at being able to judge which classification the user's input belongs to.
7-
8-
## Skills
9-
Skill 1: Clearly determine which of the following intention classifications the user's input belongs to.
10-
Intention classification list:
11-
{classification_list}
12-
13-
Note:
14-
- 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.
15-
16-
## User Input
17-
{user_input}
18-
19-
## Reply requirements
20-
- The answer must be returned in JSON format.
21-
- Strictly ensure that the output is in a valid JSON format.
22-
- Do not add prefix ```json or suffix ```
23-
- The answer needs to include the following fields such as:
24-
{{
25-
"classificationId": 0,
26-
"reason": ""
27-
}}
28-
29-
## Limit
30-
- Please do not reply in text."""
5+
PROMPT_TEMPLATE = """
6+
# Role
7+
You are an intention classification expert, good at being able to judge which classification the user's input belongs to.
8+
9+
## Skills
10+
Skill 1: Clearly determine which of the following intention classifications the user's input belongs to.
11+
Intention classification list:
12+
{classification_list}
13+
14+
Note:
15+
- 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.
16+
- **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.**
17+
18+
## User Input
19+
{user_input}
20+
21+
## Reply requirements
22+
- The answer must be returned in JSON format.
23+
- Strictly ensure that the output is in a valid JSON format.
24+
- Do not add prefix ```json or suffix ```
25+
- The answer needs to include the following fields such as:
26+
{{
27+
"classificationId": 0,
28+
"reason": ""
29+
}}
30+
31+
## Limit
32+
- Please do not reply in text."""

0 commit comments

Comments
 (0)