CCFlows / CF_CodeCriticWrongAttemptWithPlan.yaml
nbaldwin's picture
renamed flows to aiflows
a44c20f
raw
history blame contribute delete
No virus
3.04 kB
name: "CodeCriticWrongAttempt_Flow"
description: |2-
Given a problem description, a correct solution strategy, and an incorrect solution candidate, provide useful feedback for correcting the mistakes in the solution.
# ~~~ Input interface specification ~~~
input_interface_non_initialized:
- "problem_description"
- "input_description"
- "output_description"
- "io_examples_and_explanation"
- "testing_results_summary"
- "code"
- "plan"
input_interface_initialized:
- "query"
# ~~~ Output interface specification ~~~
output_interface:
- "api_output"
# ~~~ Flow specification ~~~
backend:
_target_: aiflows.backends.llm_lite.LiteLLMBackend
api_infos: ???
model_name:
openai: "gpt-4"
azure: "azure/gpt-4"
n: 1
max_tokens: 3000
temperature: 0.3
top_p: 0.2
frequency_penalty: 0
presence_penalty: 0
system_message_prompt_template:
_target_: aiflows.prompt_template.JinjaPrompt
template: |2-
Your goal is to identify the issues with an incorrect competitive programming solution attempt.
The user will specify the problem by providing you with:
- the problem statement
- input description
- output description
- example test cases
- (optional) explanation of the test cases
- an incorrect Python solution attempt and a description of its issue
Additionally, the user will provide you with a conceptual solution to the problem which should guide your reasoning.
Crucially, your goal is to consider all aspects of the problem and pinpoint the issues with the solution attempt, and not to provide the code implementation yourself.
Some aspects to consider: Is the input correctly parsed? Is the output correctly formatted? Is the code implementation consistent with the conceptual solution? Are the corner cases correctly handled? Is there a logical mistake with the algorithm itself?
Use the code execution results provided in the issue description to guide your reasoning/debugging.
input_variables: []
human_message_prompt_template:
_target_: aiflows.prompt_template.JinjaPrompt
template: "{{query}}"
input_variables:
- "query"
init_human_message_prompt_template:
_target_: aiflows.prompt_template.JinjaPrompt
template: |2-
# Problem statement
{{problem_description}}
# Input description
{{input_description}}
# Output description
{{output_description}}
{{io_examples_and_explanation}}
# Conceptual solution
{{plan}}
# Solution attempt to be fixed
```python
{{code}}
```
{{testing_results_summary}}
Consider the problem statement, the conceptual solution, the code implementation and the issue. Why is the solution attempt incorrect? How should it be fixed? Explain your reasoning very concisely, and do not provide code.
input_variables:
- "problem_description"
- "input_description"
- "output_description"
- "io_examples_and_explanation"
- "plan"
- "code"
- "testing_results_summary"