Skip to content

Commit cd98c73

Browse files
niklubnik
and
nik
authored
fix: DIA-1403: Modify the refine prompt (#226)
Co-authored-by: nik <[email protected]>
1 parent 6a60346 commit cd98c73

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

adala/skills/collection/prompt_improvement.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ def validate_prompts(self):
101101
102102
If a current prompt is provided, analyze it for potential improvements or errors. Consider how well it addresses the task description, input data and if it effectively utilizes all provided input variables.
103103
104-
Before creating the new prompt, provide a detailed reasoning for your choices. Include:
105-
1. How you addressed the context and task description
106-
2. Any potential errors or improvements you identified in the previous prompt (if applicable)
107-
3. How your new prompt better suits the target model provider
108-
4. How your prompt is designed to generate responses matching the provided schema
104+
Before creating the new prompt, provide a detailed reasoning for your choices. Using only bullet points, list the changes to be made and concisely explain why each change is necessary. Include:
105+
1. How you plan to address the context and task description
106+
2. Specific errors or improvements you've identified in the previous prompt (if applicable)
107+
3. How you intend to tailor the new prompt to better suit the target model provider
108+
4. Your strategy for designing the prompt to generate responses matching the provided schema
109109
110110
Next, generate a new short prompt title that accurately reflects the task and purpose of the prompt.
111111
@@ -168,7 +168,13 @@ def validate_prompts(self):
168168
Your output:
169169
```json
170170
{{
171-
"reasoning": "The current prompt is too vague. It doesn't specify the format or style of the summary. Addidionally, the categories instructions are not provided. It results in low quality outputs, like "summary" asnwers the question but not summarizes the input text. "history" category is not provided in the response schema, so it is not possible to produce the output. Also, not all requested input variables are used. To ensure high quality responses, I need to make the following changes: ...",
171+
"reasoning": "Changes needed:
172+
• Specify format and style of summary: The current prompt is vague, leading to inconsistent outputs.
173+
• Add categories instructions: The prompt doesn't mention categorization, resulting in missing or incorrect categories.
174+
• Use all input variables: The 'document_metadata' variable is not utilized in the current prompt.
175+
• Align with response schema: Ensure only allowed categories are used (e.g., remove 'history').
176+
• Improve clarity: Guide the model to summarize the text rather than answering questions.
177+
These changes will ensure higher quality, more consistent responses that meet the specified requirements.",
172178
"new_prompt_title": "Including categories instructions in the summary",
173179
"new_prompt_content": "Generate a detailed summary of the input text:\n'''{{text}}'''.\nUse the document metadata to guide the model to produce categories.\n#Metadata:\n'''{{document_metadata}}'''.\nEnsure high quality output by asking the model to produce a detailed summary and to categorize the document."
174180
}}

0 commit comments

Comments
 (0)