CC_flows / CF_CodeDebugCollabWithPlan.yaml
martinjosifoski's picture
Propagate changes from refactoring.
b475feb
name: "CodeDebugCollabWithPlan_Flow"
description: "ToDO: add description"
max_rounds: 2 # ToDo: To increase to 4
input_interface:
- "problem_description"
- "input_description"
- "output_description"
- "io_examples_and_explanation"
- "public_tests_individual_io"
- "plan"
output_interface:
- "code"
subflows_config:
CodeGenerator:
_target_: .CF_CodeWithPlan.instantiate_from_default_config
name: "CodeGenerator"
model_name: "gpt-4"
human_message_prompt_template:
_target_: langchain.PromptTemplate
template: |2-
{{testing_results_summary}}
{{code_feedback}}
Consider the problem statement, the last proposed solution, its issue and the provided feedback. Return a corrected version of the code that solves the original problem and resolves the issue, without any explanation, in the following format:
```python
{{code_placeholder}}
```
input_variables:
- code_feedback
- testing_results_summary
partial_variables:
code_placeholder: "{{python_code}}"
input_interface_initialized:
- "code_feedback"
- "testing_results_summary"
CodeDebugCritic:
_target_: .CF_CodeDebugCriticWithPlan.instantiate_from_default_config
topology:
# ~~~ Code Generator ~~~
- goal: "Generate/refine a solution."
### Input Interface
input_interface:
_target_: flows.interfaces.KeyInterface
additional_transformations:
- _target_: flows.data_transformations.KeyMatchInput
### Flow Specification
flow: CodeGenerator
### Output Interface
output_interface:
_target_: flows.interfaces.KeyInterface
additional_transformations:
- _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
regex: '(?<=```python)([\s\S]*?)(?=```)'
regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
input_key: "api_output"
output_key: "code"
strip: True
assert_unique: True
keys_to_select:
- "code"
reset: false
# ~~~ Code Critic Grounded in Tests ~~~
- goal: ""
### Input Interface
input_interface:
_target_: flows.interfaces.KeyInterface
additional_transformations:
- _target_: flows.data_transformations.KeyMatchInput
### Flow Specification
flow: CodeDebugCritic
reset: true