From ed27b674225231a0f9b225ffa464eb0abfe19923 Mon Sep 17 00:00:00 2001 From: stream Date: Tue, 22 Jul 2025 10:14:42 +0800 Subject: [PATCH] refactor: better template for instruction generation --- api/core/llm_generator/prompts.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/api/core/llm_generator/prompts.py b/api/core/llm_generator/prompts.py index f2fb4a9c41..6fdf8ca0df 100644 --- a/api/core/llm_generator/prompts.py +++ b/api/core/llm_generator/prompts.py @@ -410,10 +410,7 @@ Both your input and output should be in JSON format. Your output must strictly follow the schema format, do not output any content outside of the JSON body. """ # noqa: E501 -INSTRUCTION_GENERATE_TEMPLATE_PROMPT = """ -The output of this prompt is not as expected. You should edit the prompt according to the IDEAL OUTPUT. -""" +INSTRUCTION_GENERATE_TEMPLATE_PROMPT = """The output of this prompt is not as expected: {{#last_run#}}. +You should edit the prompt according to the IDEAL OUTPUT.""" -INSTRUCTION_GENERATE_TEMPLATE_CODE = """ -Please fix the errors in the error message. -""" +INSTRUCTION_GENERATE_TEMPLATE_CODE = """Please fix the errors in the {{#error_message#}}."""