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 = """