From fd90d99cd0bb46adad25ab387fa0dee8c6afbdcc Mon Sep 17 00:00:00 2001 From: Jyong <76649700+JohnJyong@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:55:52 +0800 Subject: [PATCH] question classifier prompt optimization (#3479) --- .../nodes/question_classifier/question_classifier_node.py | 2 +- api/core/workflow/nodes/question_classifier/template_prompts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/workflow/nodes/question_classifier/question_classifier_node.py b/api/core/workflow/nodes/question_classifier/question_classifier_node.py index 5ad2e1d593..6449e2c11c 100644 --- a/api/core/workflow/nodes/question_classifier/question_classifier_node.py +++ b/api/core/workflow/nodes/question_classifier/question_classifier_node.py @@ -211,7 +211,7 @@ class QuestionClassifierNode(LLMNode): model_mode = ModelMode.value_of(node_data.model.mode) classes = node_data.classes class_names = [class_.name for class_ in classes] - class_names_str = ','.join(class_names) + class_names_str = ','.join(f'"{name}"' for name in class_names) instruction = node_data.instruction if node_data.instruction else '' input_text = query memory_str = '' diff --git a/api/core/workflow/nodes/question_classifier/template_prompts.py b/api/core/workflow/nodes/question_classifier/template_prompts.py index c101ad9b19..318ad54f92 100644 --- a/api/core/workflow/nodes/question_classifier/template_prompts.py +++ b/api/core/workflow/nodes/question_classifier/template_prompts.py @@ -35,7 +35,7 @@ QUESTION_CLASSIFIER_USER_PROMPT_2 = """ QUESTION_CLASSIFIER_ASSISTANT_PROMPT_2 = """ {"keywords": ["bad service", "slow", "food", "tip", "terrible", "waitresses"], - "categories": ["Experience""]}``` + "categories": ["Experience"]}``` """ QUESTION_CLASSIFIER_USER_PROMPT_3 = """