| name: "Plan_Code_Flow" |
| description: |2- |
| Given a problem description, first generate a solution strategy and then implement the code. |
| |
| |
| input_interface: |
| - "problem_description" |
| - "input_description" |
| - "output_description" |
| - "io_examples_and_explanation" |
|
|
| |
| output_interface: |
| - "code" |
|
|
| subflows_config: |
| PlanGenerator: |
| _target_: .CF_Plan.instantiate_from_default_config |
| CodeGenerator: |
| _target_: .CF_CodeWithPlan.instantiate_from_default_config |
|
|
| |
| topology: |
| |
| - goal: "Generate a plan." |
|
|
| |
| input_interface: |
| _target_: aiflows.interfaces.KeyInterface |
| additional_transformations: |
| - _target_: aiflows.data_transformations.KeyMatchInput |
|
|
| |
| flow: PlanGenerator |
|
|
| |
| output_interface: |
| _target_: aiflows.interfaces.KeyInterface |
| additional_transformations: |
| - _target_: aiflows.data_transformations.RegexFirstOccurrenceExtractor |
| regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)' |
| regex_fallback: |
| - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)' |
| input_key: "api_output" |
| output_key: "plan" |
| strip: True |
| assert_unique: True |
| - _target_: aiflows.data_transformations.PrintPreviousMessages |
| keys_to_select: |
| - "plan" |
|
|
| |
| - goal: "Generate/refine a solution." |
|
|
| |
| input_interface: |
| _target_: aiflows.interfaces.KeyInterface |
| additional_transformations: |
| - _target_: aiflows.data_transformations.KeyMatchInput |
|
|
| |
| flow: CodeGenerator |
|
|
| |
| output_interface: |
| _target_: aiflows.interfaces.KeyInterface |
| additional_transformations: |
| - _target_: aiflows.data_transformations.RegexFirstOccurrenceExtractor |
| regex: '(?<=```python)([\s\S]*?)(?=```)' |
| regex_fallback: '(?<=```)([\s\S]*?)(?=```)' |
| input_key: "api_output" |
| output_key: "code" |
| strip: True |
| assert_unique: True |
| - _target_: aiflows.data_transformations.PrintPreviousMessages |
| keys_to_select: |
| - "code" |
|
|