raw_response->api_output

#6
by yeeef - opened
This view is limited to 50 files because it contains too many changes.  See the raw diff here.
CF_Code.py CHANGED
@@ -1,11 +1,7 @@
1
  import importlib
2
  import os
3
 
4
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
5
-
6
- # flow_module = importlib.import_module(os.getenv("OpenAIChatAtomicFlow_module"))
7
- # OpenAIChatAtomicFlow = getattr(flow_module, "OpenAIChatAtomicFlow")
8
-
9
 
10
  class CF_Code(OpenAIChatAtomicFlow):
11
  def __init__(self, **kwargs):
 
1
  import importlib
2
  import os
3
 
4
+ from flows.application_flows import OpenAIChatAtomicFlow
 
 
 
 
5
 
6
  class CF_Code(OpenAIChatAtomicFlow):
7
  def __init__(self, **kwargs):
CF_Code.yaml CHANGED
@@ -35,7 +35,7 @@ human_message_prompt_template:
35
  - "query"
36
  template_format: jinja2
37
 
38
- query_message_prompt_template:
39
  _target_: langchain.PromptTemplate
40
  template: |2-
41
  # Problem statement
@@ -65,7 +65,7 @@ query_message_prompt_template:
65
  template_format: jinja2
66
 
67
  input_data_transformations: []
68
- input_keys:
69
  - "problem_description"
70
  - "input_description"
71
  - "output_description"
@@ -75,7 +75,7 @@ output_data_transformations:
75
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
76
  regex: '(?<=```python)([\s\S]*?)(?=```)'
77
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
78
- input_key: "raw_response"
79
  output_key: "code"
80
  strip: True
81
  assert_unique: True
 
35
  - "query"
36
  template_format: jinja2
37
 
38
+ init_human_message_prompt_template:
39
  _target_: langchain.PromptTemplate
40
  template: |2-
41
  # Problem statement
 
65
  template_format: jinja2
66
 
67
  input_data_transformations: []
68
+ init_input_keys:
69
  - "problem_description"
70
  - "input_description"
71
  - "output_description"
 
75
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
76
  regex: '(?<=```python)([\s\S]*?)(?=```)'
77
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
78
+ input_key: "api_output"
79
  output_key: "code"
80
  strip: True
81
  assert_unique: True
CF_CodeCollab.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeCollab_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDO: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -13,10 +11,7 @@ input_keys:
13
  - "output_description"
14
  - "io_examples_and_explanation"
15
 
16
- output_data_transformations:
17
- - _target_: flows.data_transformations.KeyRename
18
- old_key2new_key:
19
- raw_response.code: "code"
20
  output_keys:
21
  - "code"
22
 
@@ -43,19 +38,20 @@ subflows_config:
43
  partial_variables:
44
  code_placeholder: "{{python_code}}"
45
  template_format: jinja2
46
- default_human_input_keys:
47
  - "code_feedback"
48
  output_data_transformations:
49
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
50
  regex: '(?<=```python)([\s\S]*?)(?=```)'
51
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
52
- input_key: "raw_response"
53
  output_key: "code"
54
  strip: True
55
  assert_unique: True
56
 
57
  - _target_: flows.data_transformations.EndOfInteraction
58
  end_of_interaction_string: "Final answer"
 
59
  output_key: "end_of_interaction"
60
 
61
  output_keys:
@@ -67,4 +63,8 @@ subflows_config:
67
  output_data_transformations:
68
  - _target_: flows.data_transformations.KeyRename
69
  old_key2new_key:
70
- raw_response: "code_feedback"
 
 
 
 
 
1
  name: "CodeCollab_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDO: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
11
  - "output_description"
12
  - "io_examples_and_explanation"
13
 
14
+ output_data_transformations: []
 
 
 
15
  output_keys:
16
  - "code"
17
 
 
38
  partial_variables:
39
  code_placeholder: "{{python_code}}"
40
  template_format: jinja2
41
+ input_keys:
42
  - "code_feedback"
43
  output_data_transformations:
44
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
45
  regex: '(?<=```python)([\s\S]*?)(?=```)'
46
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
47
+ input_key: "api_output"
48
  output_key: "code"
49
  strip: True
50
  assert_unique: True
51
 
52
  - _target_: flows.data_transformations.EndOfInteraction
53
  end_of_interaction_string: "Final answer"
54
+ input_key: "api_output"
55
  output_key: "end_of_interaction"
56
 
57
  output_keys:
 
63
  output_data_transformations:
64
  - _target_: flows.data_transformations.KeyRename
65
  old_key2new_key:
66
+ api_output: "code_feedback"
67
+
68
+ reset_every_round:
69
+ CodeGenerator: False # this is the name of the subflow, may be different for each config, needs to check !
70
+ CodeCritic: True
CF_CodeCritic.py CHANGED
@@ -1,7 +1,4 @@
1
- import os
2
- import importlib
3
-
4
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
5
 
6
 
7
  class CF_CodeCritic(OpenAIChatAtomicFlow):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
 
 
2
 
3
 
4
  class CF_CodeCritic(OpenAIChatAtomicFlow):
CF_CodeCritic.yaml CHANGED
@@ -37,7 +37,7 @@ human_message_prompt_template:
37
  - "query"
38
  template_format: jinja2
39
 
40
- query_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
@@ -66,7 +66,7 @@ query_message_prompt_template:
66
  - "code"
67
  template_format: jinja2
68
 
69
- input_keys:
70
  - "problem_description"
71
  - "input_description"
72
  - "output_description"
 
37
  - "query"
38
  template_format: jinja2
39
 
40
+ init_human_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
 
66
  - "code"
67
  template_format: jinja2
68
 
69
+ init_input_keys:
70
  - "problem_description"
71
  - "input_description"
72
  - "output_description"
CF_CodeCriticWrongAttempt.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class CF_CodeCriticWrongAttempt(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class CF_CodeCriticWrongAttempt(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
CF_CodeCriticWrongAttempt.yaml CHANGED
@@ -38,7 +38,7 @@ human_message_prompt_template:
38
  - "query"
39
  template_format: jinja2
40
 
41
- query_message_prompt_template:
42
  _target_: langchain.PromptTemplate
43
  template: |2-
44
  # Problem statement
@@ -71,7 +71,7 @@ query_message_prompt_template:
71
  template_format: jinja2
72
 
73
  input_data_transformations: []
74
- input_keys:
75
  - "problem_description"
76
  - "input_description"
77
  - "output_description"
@@ -82,6 +82,6 @@ input_keys:
82
  output_data_transformations:
83
  - _target_: flows.data_transformations.KeyRename
84
  old_key2new_key:
85
- raw_response: "code_feedback"
86
  output_keys:
87
  - "code_feedback"
 
38
  - "query"
39
  template_format: jinja2
40
 
41
+ init_human_message_prompt_template:
42
  _target_: langchain.PromptTemplate
43
  template: |2-
44
  # Problem statement
 
71
  template_format: jinja2
72
 
73
  input_data_transformations: []
74
+ init_input_keys:
75
  - "problem_description"
76
  - "input_description"
77
  - "output_description"
 
82
  output_data_transformations:
83
  - _target_: flows.data_transformations.KeyRename
84
  old_key2new_key:
85
+ api_output: "code_feedback"
86
  output_keys:
87
  - "code_feedback"
CF_CodeCriticWrongAttemptWithPlan.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
 
5
  class CF_CodeCriticWrongAttemptWithPlan(OpenAIChatAtomicFlow):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
 
4
  class CF_CodeCriticWrongAttemptWithPlan(OpenAIChatAtomicFlow):
CF_CodeCriticWrongAttemptWithPlan.yaml CHANGED
@@ -40,7 +40,7 @@ human_message_prompt_template:
40
  - "query"
41
  template_format: jinja2
42
 
43
- query_message_prompt_template:
44
  _target_: langchain.PromptTemplate
45
  template: |2-
46
  # Problem statement
@@ -77,7 +77,7 @@ query_message_prompt_template:
77
  template_format: jinja2
78
 
79
  input_data_transformations: []
80
- input_keys:
81
  - "problem_description"
82
  - "input_description"
83
  - "output_description"
@@ -89,6 +89,6 @@ input_keys:
89
  output_data_transformations:
90
  - _target_: flows.data_transformations.KeyRename
91
  old_key2new_key:
92
- raw_response: "code_feedback"
93
  output_keys:
94
  - "code_feedback"
 
40
  - "query"
41
  template_format: jinja2
42
 
43
+ init_human_message_prompt_template:
44
  _target_: langchain.PromptTemplate
45
  template: |2-
46
  # Problem statement
 
77
  template_format: jinja2
78
 
79
  input_data_transformations: []
80
+ init_input_keys:
81
  - "problem_description"
82
  - "input_description"
83
  - "output_description"
 
89
  output_data_transformations:
90
  - _target_: flows.data_transformations.KeyRename
91
  old_key2new_key:
92
+ api_output: "code_feedback"
93
  output_keys:
94
  - "code_feedback"
CF_CodeDebug.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeDebug_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -17,7 +15,7 @@ input_keys:
17
  output_data_transformations:
18
  - _target_: flows.data_transformations.KeyRename
19
  old_key2new_key:
20
- raw_response.code: "code"
21
  output_keys:
22
  - "code"
23
 
@@ -39,20 +37,21 @@ subflows_config:
39
  - testing_results_summary
40
  partial_variables:
41
  code_placeholder: "{{python_code}}"
42
- default_human_input_keys:
43
  - "testing_results_summary"
44
  - "all_tests_passed"
45
  output_data_transformations:
46
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
47
  regex: '(?<=```python)([\s\S]*?)(?=```)'
48
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
49
- input_key: "raw_response"
50
  output_key: "code"
51
  strip: True
52
  assert_unique: True
53
 
54
  - _target_: flows.data_transformations.EndOfInteraction
55
  end_of_interaction_string: "Final answer"
 
56
  output_key: "end_of_interaction"
57
 
58
  output_keys:
@@ -61,3 +60,7 @@ subflows_config:
61
  - _target_: martinjosifoski.CC_flows.CF_CodeTesting.instantiate_from_default_config
62
  overrides:
63
  name: "CodeTestingCritic"
 
 
 
 
 
1
  name: "CodeDebug_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ code: "code"
19
  output_keys:
20
  - "code"
21
 
 
37
  - testing_results_summary
38
  partial_variables:
39
  code_placeholder: "{{python_code}}"
40
+ input_keys:
41
  - "testing_results_summary"
42
  - "all_tests_passed"
43
  output_data_transformations:
44
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
45
  regex: '(?<=```python)([\s\S]*?)(?=```)'
46
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
47
+ input_key: "api_output"
48
  output_key: "code"
49
  strip: True
50
  assert_unique: True
51
 
52
  - _target_: flows.data_transformations.EndOfInteraction
53
  end_of_interaction_string: "Final answer"
54
+ input_key: "api_output"
55
  output_key: "end_of_interaction"
56
 
57
  output_keys:
 
60
  - _target_: martinjosifoski.CC_flows.CF_CodeTesting.instantiate_from_default_config
61
  overrides:
62
  name: "CodeTestingCritic"
63
+
64
+ reset_every_round:
65
+ CodeGenerator: False # this is the name of the subflow, may be different for each config, needs to check !
66
+ CodeTestingCritic: True
CF_CodeDebugCollab.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeDebugCollab_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -17,7 +15,7 @@ input_keys:
17
  output_data_transformations:
18
  - _target_: flows.data_transformations.KeyRename
19
  old_key2new_key:
20
- raw_response.code: "code"
21
  output_keys:
22
  - "code"
23
 
@@ -44,23 +42,29 @@ subflows_config:
44
  partial_variables:
45
  code_placeholder: "{{python_code}}"
46
  template_format: jinja2
47
- default_human_input_keys:
48
  - "code_feedback"
49
  - "testing_results_summary"
50
  output_data_transformations:
51
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
52
  regex: '(?<=```python)([\s\S]*?)(?=```)'
53
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
54
- input_key: "raw_response"
55
  output_key: "code"
56
  strip: True
57
  assert_unique: True
58
 
59
  - _target_: flows.data_transformations.EndOfInteraction
60
  end_of_interaction_string: "Final answer"
 
61
  output_key: "end_of_interaction"
62
 
63
  output_keys:
64
  - "code"
65
  - "end_of_interaction"
66
  - _target_: martinjosifoski.CC_flows.CF_CodeDebugCritic.instantiate_from_default_config
 
 
 
 
 
 
1
  name: "CodeDebugCollab_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ code: "code"
19
  output_keys:
20
  - "code"
21
 
 
42
  partial_variables:
43
  code_placeholder: "{{python_code}}"
44
  template_format: jinja2
45
+ input_keys:
46
  - "code_feedback"
47
  - "testing_results_summary"
48
  output_data_transformations:
49
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
50
  regex: '(?<=```python)([\s\S]*?)(?=```)'
51
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
52
+ input_key: "api_output"
53
  output_key: "code"
54
  strip: True
55
  assert_unique: True
56
 
57
  - _target_: flows.data_transformations.EndOfInteraction
58
  end_of_interaction_string: "Final answer"
59
+ input_key: "api_output"
60
  output_key: "end_of_interaction"
61
 
62
  output_keys:
63
  - "code"
64
  - "end_of_interaction"
65
  - _target_: martinjosifoski.CC_flows.CF_CodeDebugCritic.instantiate_from_default_config
66
+
67
+
68
+ reset_every_round:
69
+ CodeGenerator: False # this is the name of the subflow, may be different for each config, needs to check !
70
+ CodeDebugCritic_Flow: True
CF_CodeDebugCollabWithPlan.yaml CHANGED
@@ -1,8 +1,7 @@
1
  name: "CodeDebugCollabWithPlan_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -18,7 +17,7 @@ input_keys:
18
  output_data_transformations:
19
  - _target_: flows.data_transformations.KeyRename
20
  old_key2new_key:
21
- raw_response.code: "code"
22
  output_keys:
23
  - "code"
24
 
@@ -45,23 +44,28 @@ subflows_config:
45
  partial_variables:
46
  code_placeholder: "{{python_code}}"
47
  template_format: jinja2
48
- default_human_input_keys:
49
  - "code_feedback"
50
  - "testing_results_summary"
51
  output_data_transformations:
52
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
53
  regex: '(?<=```python)([\s\S]*?)(?=```)'
54
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
55
- input_key: "raw_response"
56
  output_key: "code"
57
  strip: True
58
  assert_unique: True
59
 
60
  - _target_: flows.data_transformations.EndOfInteraction
61
  end_of_interaction_string: "Final answer"
 
62
  output_key: "end_of_interaction"
63
 
64
  output_keys:
65
  - "code"
66
  - "end_of_interaction"
67
  - _target_: martinjosifoski.CC_flows.CF_CodeDebugCriticWithPlan.instantiate_from_default_config
 
 
 
 
 
1
  name: "CodeDebugCollabWithPlan_Flow"
2
  description: "ToDO: add description"
3
 
4
+
 
5
  max_rounds: 2 # ToDo: To increase to 4
6
  early_exit_key: "end_of_interaction"
7
 
 
17
  output_data_transformations:
18
  - _target_: flows.data_transformations.KeyRename
19
  old_key2new_key:
20
+ code: "code"
21
  output_keys:
22
  - "code"
23
 
 
44
  partial_variables:
45
  code_placeholder: "{{python_code}}"
46
  template_format: jinja2
47
+ input_keys:
48
  - "code_feedback"
49
  - "testing_results_summary"
50
  output_data_transformations:
51
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
52
  regex: '(?<=```python)([\s\S]*?)(?=```)'
53
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
54
+ input_key: "api_output"
55
  output_key: "code"
56
  strip: True
57
  assert_unique: True
58
 
59
  - _target_: flows.data_transformations.EndOfInteraction
60
  end_of_interaction_string: "Final answer"
61
+ input_key: "api_output"
62
  output_key: "end_of_interaction"
63
 
64
  output_keys:
65
  - "code"
66
  - "end_of_interaction"
67
  - _target_: martinjosifoski.CC_flows.CF_CodeDebugCriticWithPlan.instantiate_from_default_config
68
+
69
+ reset_every_round:
70
+ CodeGenerator: False
71
+ CodeDebugCriticWithPlan_Flow: True
CF_CodeDebugCritic.yaml CHANGED
@@ -15,9 +15,9 @@ input_keys:
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
- raw_response.testing_results_summary: "testing_results_summary"
19
- raw_response.all_tests_passed: "all_tests_passed"
20
- raw_response.code_feedback: "code_feedback"
21
  output_keys:
22
  - "testing_results_summary"
23
  - "all_tests_passed"
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ testing_results_summary: "testing_results_summary"
19
+ all_tests_passed: "all_tests_passed"
20
+ code_feedback: "code_feedback"
21
  output_keys:
22
  - "testing_results_summary"
23
  - "all_tests_passed"
CF_CodeDebugCriticWithPlan.yaml CHANGED
@@ -16,9 +16,9 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.testing_results_summary: "testing_results_summary"
20
- raw_response.all_tests_passed: "all_tests_passed"
21
- raw_response.code_feedback: "code_feedback"
22
  output_keys:
23
  - "testing_results_summary"
24
  - "all_tests_passed"
 
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
+ testing_results_summary: "testing_results_summary"
20
+ all_tests_passed: "all_tests_passed"
21
+ code_feedback: "code_feedback"
22
  output_keys:
23
  - "testing_results_summary"
24
  - "all_tests_passed"
CF_CodeReflect.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeReflect_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -16,7 +14,7 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.code: "code"
20
  output_keys:
21
  - "code"
22
 
@@ -33,12 +31,14 @@ subflows_config:
33
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
34
  regex: '(?<=```python)([\s\S]*?)(?=```)'
35
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
 
36
  output_key: "code"
37
  strip: True
38
  assert_unique: True
39
 
40
  - _target_: flows.data_transformations.EndOfInteraction
41
  end_of_interaction_string: "Final answer"
 
42
  output_key: "end_of_interaction"
43
 
44
  output_keys:
@@ -46,3 +46,8 @@ subflows_config:
46
  - "end_of_interaction"
47
 
48
  - _target_: martinjosifoski.CC_flows.FixedReply_CodeReflect.instantiate_from_default_config
 
 
 
 
 
 
1
  name: "CodeReflect_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
14
  output_data_transformations:
15
  - _target_: flows.data_transformations.KeyRename
16
  old_key2new_key:
17
+ code: "code"
18
  output_keys:
19
  - "code"
20
 
 
31
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
32
  regex: '(?<=```python)([\s\S]*?)(?=```)'
33
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
34
+ input_key: "api_output"
35
  output_key: "code"
36
  strip: True
37
  assert_unique: True
38
 
39
  - _target_: flows.data_transformations.EndOfInteraction
40
  end_of_interaction_string: "Final answer"
41
+ input_key: "api_output"
42
  output_key: "end_of_interaction"
43
 
44
  output_keys:
 
46
  - "end_of_interaction"
47
 
48
  - _target_: martinjosifoski.CC_flows.FixedReply_CodeReflect.instantiate_from_default_config
49
+
50
+
51
+ reset_every_round:
52
+ CodeGenerator: False # this is the name of the subflow, may be different for each config, needs to check !
53
+ CodeReflectCritic: True
CF_CodeTesting.yaml CHANGED
@@ -10,7 +10,7 @@ output_keys:
10
  - "testing_results_summary"
11
  output_data_transformations:
12
  - _target_: martinjosifoski.CC_flows.src.data_transformations.CorrectnessFlag # ToDo: This import style would not work if the flow is synced in the current implementation (the outer directory is a hash and not the name; figure out how to do the import robustly; e.g., using relative imports)
13
- input_key: "raw_response.public_tests_results"
14
  output_key: "all_tests_passed"
15
  - _target_: martinjosifoski.CC_flows.src.data_transformations.TestingResultsSummaryGeneration
16
  output_key: "testing_results_summary"
 
10
  - "testing_results_summary"
11
  output_data_transformations:
12
  - _target_: martinjosifoski.CC_flows.src.data_transformations.CorrectnessFlag # ToDo: This import style would not work if the flow is synced in the current implementation (the outer directory is a hash and not the name; figure out how to do the import robustly; e.g., using relative imports)
13
+ input_key: "public_tests_results"
14
  output_key: "all_tests_passed"
15
  - _target_: martinjosifoski.CC_flows.src.data_transformations.TestingResultsSummaryGeneration
16
  output_key: "testing_results_summary"
CF_CodeWithPlan.py CHANGED
@@ -1,6 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
-
4
 
5
  class CF_CodeWithPlan(OpenAIChatAtomicFlow):
6
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
 
2
 
3
  class CF_CodeWithPlan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
CF_CodeWithPlan.yaml CHANGED
@@ -37,7 +37,7 @@ human_message_prompt_template:
37
  - "query"
38
  template_format: jinja2
39
 
40
- query_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
@@ -71,7 +71,7 @@ query_message_prompt_template:
71
  template_format: jinja2
72
 
73
  input_data_transformations: []
74
- input_keys:
75
  - "problem_description"
76
  - "input_description"
77
  - "output_description"
@@ -82,6 +82,7 @@ output_data_transformations:
82
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
83
  regex: '(?<=```python)([\s\S]*?)(?=```)'
84
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
 
85
  output_key: "code"
86
  strip: True
87
  assert_unique: True
 
37
  - "query"
38
  template_format: jinja2
39
 
40
+ init_human_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
 
71
  template_format: jinja2
72
 
73
  input_data_transformations: []
74
+ init_input_keys:
75
  - "problem_description"
76
  - "input_description"
77
  - "output_description"
 
82
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
83
  regex: '(?<=```python)([\s\S]*?)(?=```)'
84
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
85
+ input_key: "api_output"
86
  output_key: "code"
87
  strip: True
88
  assert_unique: True
CF_Plan.py CHANGED
@@ -1,4 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
 
3
  class CF_Plan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
2
 
3
  class CF_Plan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
CF_Plan.yaml CHANGED
@@ -13,7 +13,7 @@ generation_parameters:
13
  presence_penalty: 0
14
 
15
  input_data_transformations: []
16
- input_keys:
17
  - "problem_description"
18
  - "input_description"
19
  - "output_description"
@@ -24,6 +24,7 @@ output_data_transformations:
24
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
25
  regex_fallback:
26
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
 
27
  output_key: "plan"
28
  strip: True
29
  assert_unique: True
@@ -56,7 +57,7 @@ human_message_prompt_template:
56
  - "query"
57
  template_format: jinja2
58
 
59
- query_message_prompt_template:
60
  _target_: langchain.PromptTemplate
61
  template: |2-
62
  # Problem statement
 
13
  presence_penalty: 0
14
 
15
  input_data_transformations: []
16
+ init_input_keys:
17
  - "problem_description"
18
  - "input_description"
19
  - "output_description"
 
24
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
25
  regex_fallback:
26
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
27
+ input_key: "api_output"
28
  output_key: "plan"
29
  strip: True
30
  assert_unique: True
 
57
  - "query"
58
  template_format: jinja2
59
 
60
+ init_human_message_prompt_template:
61
  _target_: langchain.PromptTemplate
62
  template: |2-
63
  # Problem statement
CF_PlanCollab.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "PlanCollab_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -16,7 +14,7 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.plan: "plan"
20
  output_keys:
21
  - "plan"
22
 
@@ -41,19 +39,21 @@ subflows_config:
41
  partial_variables:
42
  plan_placeholder: "{{conceptual_solution}}"
43
  template_format: jinja2
44
- default_human_input_keys:
45
  - "plan_feedback"
46
  output_data_transformations:
47
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
48
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
49
  regex_fallback:
50
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
 
51
  output_key: "plan"
52
  strip: True
53
  assert_unique: True
54
 
55
  - _target_: flows.data_transformations.EndOfInteraction
56
  end_of_interaction_string: "Final answer"
 
57
  output_key: "end_of_interaction"
58
 
59
  output_keys:
@@ -65,4 +65,8 @@ subflows_config:
65
  output_data_transformations:
66
  - _target_: flows.data_transformations.KeyRename
67
  old_key2new_key:
68
- raw_response: "plan_feedback"
 
 
 
 
 
1
  name: "PlanCollab_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
14
  output_data_transformations:
15
  - _target_: flows.data_transformations.KeyRename
16
  old_key2new_key:
17
+ plan: "plan"
18
  output_keys:
19
  - "plan"
20
 
 
39
  partial_variables:
40
  plan_placeholder: "{{conceptual_solution}}"
41
  template_format: jinja2
42
+ input_keys:
43
  - "plan_feedback"
44
  output_data_transformations:
45
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
46
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
47
  regex_fallback:
48
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
49
+ input_key: "api_output"
50
  output_key: "plan"
51
  strip: True
52
  assert_unique: True
53
 
54
  - _target_: flows.data_transformations.EndOfInteraction
55
  end_of_interaction_string: "Final answer"
56
+ input_key: "api_output"
57
  output_key: "end_of_interaction"
58
 
59
  output_keys:
 
65
  output_data_transformations:
66
  - _target_: flows.data_transformations.KeyRename
67
  old_key2new_key:
68
+ api_output: "plan_feedback"
69
+
70
+ reset_every_round:
71
+ PlanGenerator: false
72
+ PlanCritic: true
CF_PlanCollab_Code.yaml CHANGED
@@ -13,7 +13,7 @@ input_keys:
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
- raw_response.code: "code"
17
  output_keys:
18
  - "code"
19
 
 
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
+ code: "code"
17
  output_keys:
18
  - "code"
19
 
CF_PlanCritic.py CHANGED
@@ -1,4 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
 
3
 
4
  class CF_PlanCritic(OpenAIChatAtomicFlow):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
2
 
3
 
4
  class CF_PlanCritic(OpenAIChatAtomicFlow):
CF_PlanCritic.yaml CHANGED
@@ -38,7 +38,7 @@ human_message_prompt_template:
38
  - "query"
39
  template_format: jinja2
40
 
41
- query_message_prompt_template:
42
  _target_: langchain.PromptTemplate
43
  template: |2-
44
  # Problem statement
@@ -65,7 +65,7 @@ query_message_prompt_template:
65
  - "plan"
66
  template_format: jinja2
67
 
68
- input_keys:
69
  - "problem_description"
70
  - "input_description"
71
  - "output_description"
 
38
  - "query"
39
  template_format: jinja2
40
 
41
+ init_human_message_prompt_template:
42
  _target_: langchain.PromptTemplate
43
  template: |2-
44
  # Problem statement
 
65
  - "plan"
66
  template_format: jinja2
67
 
68
+ init_input_keys:
69
  - "problem_description"
70
  - "input_description"
71
  - "output_description"
CF_PlanReflect.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "PlanReflect_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -16,7 +14,7 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.plan: "plan"
20
  output_keys:
21
  - "plan"
22
 
@@ -34,12 +32,14 @@ subflows_config:
34
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
35
  regex_fallback:
36
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
 
37
  output_key: "plan"
38
  strip: True
39
  assert_unique: True
40
 
41
  - _target_: flows.data_transformations.EndOfInteraction
42
  end_of_interaction_string: "Final answer"
 
43
  output_key: "end_of_interaction"
44
 
45
  output_keys:
@@ -48,3 +48,7 @@ subflows_config:
48
 
49
  - _target_: martinjosifoski.CC_flows.FixedReply_PlanReflect.instantiate_from_default_config
50
 
 
 
 
 
 
1
  name: "PlanReflect_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
14
  output_data_transformations:
15
  - _target_: flows.data_transformations.KeyRename
16
  old_key2new_key:
17
+ plan: "plan"
18
  output_keys:
19
  - "plan"
20
 
 
32
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
33
  regex_fallback:
34
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
35
+ input_key: "api_output"
36
  output_key: "plan"
37
  strip: True
38
  assert_unique: True
39
 
40
  - _target_: flows.data_transformations.EndOfInteraction
41
  end_of_interaction_string: "Final answer"
42
+ input_key: "api_output"
43
  output_key: "end_of_interaction"
44
 
45
  output_keys:
 
48
 
49
  - _target_: martinjosifoski.CC_flows.FixedReply_PlanReflect.instantiate_from_default_config
50
 
51
+
52
+ reset_every_round:
53
+ PlanGenerator_Flow: False # this is the name of the subflow, may be different for each config, needs to check !
54
+ PlanReflectCritic: True
CF_PlanReflect_Code.yaml CHANGED
@@ -13,7 +13,7 @@ input_keys:
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
- raw_response.code: "code"
17
  output_keys:
18
  - "code"
19
 
 
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
+ code: "code"
17
  output_keys:
18
  - "code"
19
 
CF_Plan_Code.yaml CHANGED
@@ -13,7 +13,7 @@ input_keys:
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
- raw_response.code: "code"
17
  output_keys:
18
  - "code"
19
 
 
13
  output_data_transformations:
14
  - _target_: flows.data_transformations.KeyRename
15
  old_key2new_key:
16
+ code: "code"
17
  output_keys:
18
  - "code"
19
 
CodeTesting.py CHANGED
@@ -33,14 +33,12 @@ class CodeTesting(AtomicFlow):
33
  return cls(**kwargs)
34
 
35
  def run(self,
36
- input_data: Dict[str, Any],
37
- private_keys: Optional[List[str]] = [],
38
- keys_to_ignore_for_hash: Optional[List[str]] = []) -> Dict[str, Any]:
39
 
40
  # ~~~ Retrieve the test data ~~~
41
  test_data = self._get_test_data(input_data)
42
 
43
  # ~~~ Run tests ~~~
44
- response = self._run_tests(input_data, test_data)
45
 
46
  return response
 
33
  return cls(**kwargs)
34
 
35
  def run(self,
36
+ input_data: Dict[str, Any]) -> Dict[str, Any]:
 
 
37
 
38
  # ~~~ Retrieve the test data ~~~
39
  test_data = self._get_test_data(input_data)
40
 
41
  # ~~~ Run tests ~~~
42
+ response: Dict[str, Any] = self._run_tests(input_data, test_data)
43
 
44
  return response
FixedReply_CodeReflect.yaml CHANGED
@@ -8,7 +8,7 @@ input_keys: []
8
  output_data_transformations:
9
  - _target_: flows.data_transformations.KeyRename
10
  old_key2new_key:
11
- raw_response: "code_reflect_message"
12
  output_keys:
13
  - "code_reflect_message"
14
 
 
8
  output_data_transformations:
9
  - _target_: flows.data_transformations.KeyRename
10
  old_key2new_key:
11
+ fixed_reply: "code_reflect_message"
12
  output_keys:
13
  - "code_reflect_message"
14
 
FixedReply_PlanReflect.yaml CHANGED
@@ -8,7 +8,7 @@ input_keys: []
8
  output_data_transformations:
9
  - _target_: flows.data_transformations.KeyRename
10
  old_key2new_key:
11
- raw_response: "plan_reflect_message"
12
  output_keys:
13
  - "plan_reflect_message"
14
 
 
8
  output_data_transformations:
9
  - _target_: flows.data_transformations.KeyRename
10
  old_key2new_key:
11
+ fixed_reply: "plan_reflect_message"
12
  output_keys:
13
  - "plan_reflect_message"
14
 
LC_Code.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class LC_Code(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class LC_Code(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_Code.yaml CHANGED
@@ -33,7 +33,7 @@ human_message_prompt_template:
33
  - "query"
34
  template_format: jinja2
35
 
36
- query_message_prompt_template:
37
  _target_: langchain.PromptTemplate
38
  template: |2-
39
  # Problem statement
@@ -64,7 +64,7 @@ query_message_prompt_template:
64
  template_format: jinja2
65
 
66
  input_data_transformations: []
67
- input_keys:
68
  - "problem_description"
69
  - "io_description"
70
  - "constraints"
@@ -74,7 +74,7 @@ output_data_transformations:
74
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
75
  regex: '(?<=```python)([\s\S]*?)(?=```)'
76
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
77
- input_key: "raw_response"
78
  output_key: "code"
79
  strip: True
80
  assert_unique: True
 
33
  - "query"
34
  template_format: jinja2
35
 
36
+ init_human_message_prompt_template:
37
  _target_: langchain.PromptTemplate
38
  template: |2-
39
  # Problem statement
 
64
  template_format: jinja2
65
 
66
  input_data_transformations: []
67
+ init_input_keys:
68
  - "problem_description"
69
  - "io_description"
70
  - "constraints"
 
74
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
75
  regex: '(?<=```python)([\s\S]*?)(?=```)'
76
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
77
+ input_key: "api_output"
78
  output_key: "code"
79
  strip: True
80
  assert_unique: True
LC_CodeCollab.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeCollab_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDO: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -16,7 +14,7 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.code: "code"
20
  output_keys:
21
  - "code"
22
 
@@ -43,19 +41,20 @@ subflows_config:
43
  partial_variables:
44
  code_placeholder: "{{python_code}}"
45
  template_format: jinja2
46
- default_human_input_keys:
47
  - "code_feedback"
48
  output_data_transformations:
49
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
50
  regex: '(?<=```python)([\s\S]*?)(?=```)'
51
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
52
- input_key: "raw_response"
53
  output_key: "code"
54
  strip: True
55
  assert_unique: True
56
 
57
  - _target_: flows.data_transformations.EndOfInteraction
58
  end_of_interaction_string: "Final answer"
 
59
  output_key: "end_of_interaction"
60
 
61
  output_keys:
@@ -67,4 +66,8 @@ subflows_config:
67
  output_data_transformations:
68
  - _target_: flows.data_transformations.KeyRename
69
  old_key2new_key:
70
- raw_response: "code_feedback"
 
 
 
 
 
1
  name: "CodeCollab_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDO: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
14
  output_data_transformations:
15
  - _target_: flows.data_transformations.KeyRename
16
  old_key2new_key:
17
+ code: "code"
18
  output_keys:
19
  - "code"
20
 
 
41
  partial_variables:
42
  code_placeholder: "{{python_code}}"
43
  template_format: jinja2
44
+ input_keys:
45
  - "code_feedback"
46
  output_data_transformations:
47
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
48
  regex: '(?<=```python)([\s\S]*?)(?=```)'
49
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
50
+ input_key: "api_output"
51
  output_key: "code"
52
  strip: True
53
  assert_unique: True
54
 
55
  - _target_: flows.data_transformations.EndOfInteraction
56
  end_of_interaction_string: "Final answer"
57
+ input_key: "api_output"
58
  output_key: "end_of_interaction"
59
 
60
  output_keys:
 
66
  output_data_transformations:
67
  - _target_: flows.data_transformations.KeyRename
68
  old_key2new_key:
69
+ api_output: "code_feedback"
70
+
71
+ reset_every_round:
72
+ CodeGenerator: False
73
+ CodeCritic: True
LC_CodeCritic.py CHANGED
@@ -1,6 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
-
4
 
5
  class LC_CodeCritic(OpenAIChatAtomicFlow):
6
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
 
2
 
3
  class LC_CodeCritic(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_CodeCritic.yaml CHANGED
@@ -36,7 +36,7 @@ human_message_prompt_template:
36
  - "query"
37
  template_format: jinja2
38
 
39
- query_message_prompt_template:
40
  _target_: langchain.PromptTemplate
41
  template: |2-
42
  # Problem statement
@@ -67,7 +67,7 @@ query_message_prompt_template:
67
  - "code"
68
  template_format: jinja2
69
 
70
- input_keys:
71
  - "problem_description"
72
  - "io_description"
73
  - "constraints"
 
36
  - "query"
37
  template_format: jinja2
38
 
39
+ init_human_message_prompt_template:
40
  _target_: langchain.PromptTemplate
41
  template: |2-
42
  # Problem statement
 
67
  - "code"
68
  template_format: jinja2
69
 
70
+ init_input_keys:
71
  - "problem_description"
72
  - "io_description"
73
  - "constraints"
LC_CodeCriticWrongAttempt.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class LC_CodeCriticWrongAttempt(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class LC_CodeCriticWrongAttempt(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_CodeCriticWrongAttempt.yaml CHANGED
@@ -37,7 +37,7 @@ human_message_prompt_template:
37
  - "query"
38
  template_format: jinja2
39
 
40
- query_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
@@ -72,7 +72,7 @@ query_message_prompt_template:
72
  template_format: jinja2
73
 
74
  input_data_transformations: []
75
- input_keys:
76
  - "problem_description"
77
  - "io_description"
78
  - "constraints"
@@ -83,6 +83,6 @@ input_keys:
83
  output_data_transformations:
84
  - _target_: flows.data_transformations.KeyRename
85
  old_key2new_key:
86
- raw_response: "code_feedback"
87
  output_keys:
88
  - "code_feedback"
 
37
  - "query"
38
  template_format: jinja2
39
 
40
+ init_human_message_prompt_template:
41
  _target_: langchain.PromptTemplate
42
  template: |2-
43
  # Problem statement
 
72
  template_format: jinja2
73
 
74
  input_data_transformations: []
75
+ init_input_keys:
76
  - "problem_description"
77
  - "io_description"
78
  - "constraints"
 
83
  output_data_transformations:
84
  - _target_: flows.data_transformations.KeyRename
85
  old_key2new_key:
86
+ api_output: "code_feedback"
87
  output_keys:
88
  - "code_feedback"
LC_CodeCriticWrongAttemptWithPlan.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class LC_CodeCriticWrongAttemptWithPlan(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class LC_CodeCriticWrongAttemptWithPlan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_CodeCriticWrongAttemptWithPlan.yaml CHANGED
@@ -39,7 +39,7 @@ human_message_prompt_template:
39
  - "query"
40
  template_format: jinja2
41
 
42
- query_message_prompt_template:
43
  _target_: langchain.PromptTemplate
44
  template: |2-
45
  # Problem statement
@@ -79,7 +79,7 @@ query_message_prompt_template:
79
  template_format: jinja2
80
 
81
  input_data_transformations: []
82
- input_keys:
83
  - "problem_description"
84
  - "io_description"
85
  - "constraints"
@@ -91,6 +91,6 @@ input_keys:
91
  output_data_transformations:
92
  - _target_: flows.data_transformations.KeyRename
93
  old_key2new_key:
94
- raw_response: "code_feedback"
95
  output_keys:
96
  - "code_feedback"
 
39
  - "query"
40
  template_format: jinja2
41
 
42
+ init_human_message_prompt_template:
43
  _target_: langchain.PromptTemplate
44
  template: |2-
45
  # Problem statement
 
79
  template_format: jinja2
80
 
81
  input_data_transformations: []
82
+ init_input_keys:
83
  - "problem_description"
84
  - "io_description"
85
  - "constraints"
 
91
  output_data_transformations:
92
  - _target_: flows.data_transformations.KeyRename
93
  old_key2new_key:
94
+ api_output: "code_feedback"
95
  output_keys:
96
  - "code_feedback"
LC_CodeDebug.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeDebug_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -17,7 +15,7 @@ input_keys:
17
  output_data_transformations:
18
  - _target_: flows.data_transformations.KeyRename
19
  old_key2new_key:
20
- raw_response.code: "code"
21
  output_keys:
22
  - "code"
23
 
@@ -39,20 +37,21 @@ subflows_config:
39
  - testing_results_summary
40
  partial_variables:
41
  code_placeholder: "{{python_code}}"
42
- default_human_input_keys:
43
  - "testing_results_summary"
44
  - "all_tests_passed"
45
  output_data_transformations:
46
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
47
  regex: '(?<=```python)([\s\S]*?)(?=```)'
48
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
49
- input_key: "raw_response"
50
  output_key: "code"
51
  strip: True
52
  assert_unique: True
53
 
54
  - _target_: flows.data_transformations.EndOfInteraction
55
  end_of_interaction_string: "Final answer"
 
56
  output_key: "end_of_interaction"
57
 
58
  output_keys:
@@ -61,3 +60,7 @@ subflows_config:
61
  - _target_: martinjosifoski.CC_flows.LC_CodeTesting.instantiate_from_default_config
62
  overrides:
63
  name: "CodeTestingCritic"
 
 
 
 
 
1
  name: "CodeDebug_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ code: "code"
19
  output_keys:
20
  - "code"
21
 
 
37
  - testing_results_summary
38
  partial_variables:
39
  code_placeholder: "{{python_code}}"
40
+ input_keys:
41
  - "testing_results_summary"
42
  - "all_tests_passed"
43
  output_data_transformations:
44
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
45
  regex: '(?<=```python)([\s\S]*?)(?=```)'
46
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
47
+ input_key: "api_output"
48
  output_key: "code"
49
  strip: True
50
  assert_unique: True
51
 
52
  - _target_: flows.data_transformations.EndOfInteraction
53
  end_of_interaction_string: "Final answer"
54
+ input_key: "api_output"
55
  output_key: "end_of_interaction"
56
 
57
  output_keys:
 
60
  - _target_: martinjosifoski.CC_flows.LC_CodeTesting.instantiate_from_default_config
61
  overrides:
62
  name: "CodeTestingCritic"
63
+
64
+ reset_every_round:
65
+ CodeGenerator: False
66
+ CodeTestingCritic: True
LC_CodeDebugCollab.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeDebugCollab_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -17,7 +15,7 @@ input_keys:
17
  output_data_transformations:
18
  - _target_: flows.data_transformations.KeyRename
19
  old_key2new_key:
20
- raw_response.code: "code"
21
  output_keys:
22
  - "code"
23
 
@@ -44,20 +42,21 @@ subflows_config:
44
  partial_variables:
45
  code_placeholder: "{{python_code}}"
46
  template_format: jinja2
47
- default_human_input_keys:
48
  - "code_feedback"
49
  - "testing_results_summary"
50
  output_data_transformations:
51
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
52
  regex: '(?<=```python)([\s\S]*?)(?=```)'
53
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
54
- input_key: "raw_response"
55
  output_key: "code"
56
  strip: True
57
  assert_unique: True
58
 
59
  - _target_: flows.data_transformations.EndOfInteraction
60
  end_of_interaction_string: "Final answer"
 
61
  output_key: "end_of_interaction"
62
 
63
  output_keys:
@@ -65,3 +64,7 @@ subflows_config:
65
  - "end_of_interaction"
66
  - _target_: martinjosifoski.CC_flows.LC_CodeDebugCritic.instantiate_from_default_config
67
 
 
 
 
 
 
1
  name: "CodeDebugCollab_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ code: "code"
19
  output_keys:
20
  - "code"
21
 
 
42
  partial_variables:
43
  code_placeholder: "{{python_code}}"
44
  template_format: jinja2
45
+ input_keys:
46
  - "code_feedback"
47
  - "testing_results_summary"
48
  output_data_transformations:
49
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
50
  regex: '(?<=```python)([\s\S]*?)(?=```)'
51
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
52
+ input_key: "api_output"
53
  output_key: "code"
54
  strip: True
55
  assert_unique: True
56
 
57
  - _target_: flows.data_transformations.EndOfInteraction
58
  end_of_interaction_string: "Final answer"
59
+ input_key: "api_output"
60
  output_key: "end_of_interaction"
61
 
62
  output_keys:
 
64
  - "end_of_interaction"
65
  - _target_: martinjosifoski.CC_flows.LC_CodeDebugCritic.instantiate_from_default_config
66
 
67
+
68
+ reset_every_round:
69
+ CodeGenerator: False
70
+ CodeDebugCritic_Flow: True
LC_CodeDebugCollabWithPlan.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeDebugCollabWithPlan_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -18,7 +16,7 @@ input_keys:
18
  output_data_transformations:
19
  - _target_: flows.data_transformations.KeyRename
20
  old_key2new_key:
21
- raw_response.code: "code"
22
  output_keys:
23
  - "code"
24
 
@@ -45,23 +43,29 @@ subflows_config:
45
  partial_variables:
46
  code_placeholder: "{{python_code}}"
47
  template_format: jinja2
48
- default_human_input_keys:
49
  - "code_feedback"
50
  - "testing_results_summary"
51
  output_data_transformations:
52
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
53
  regex: '(?<=```python)([\s\S]*?)(?=```)'
54
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
55
- input_key: "raw_response"
56
  output_key: "code"
57
  strip: True
58
  assert_unique: True
59
 
60
  - _target_: flows.data_transformations.EndOfInteraction
61
  end_of_interaction_string: "Final answer"
 
62
  output_key: "end_of_interaction"
63
 
64
  output_keys:
65
  - "code"
66
  - "end_of_interaction"
67
  - _target_: martinjosifoski.CC_flows.LC_CodeDebugCriticWithPlan.instantiate_from_default_config
 
 
 
 
 
 
1
  name: "CodeDebugCollabWithPlan_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
+ code: "code"
20
  output_keys:
21
  - "code"
22
 
 
43
  partial_variables:
44
  code_placeholder: "{{python_code}}"
45
  template_format: jinja2
46
+ input_keys:
47
  - "code_feedback"
48
  - "testing_results_summary"
49
  output_data_transformations:
50
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
51
  regex: '(?<=```python)([\s\S]*?)(?=```)'
52
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
53
+ input_key: "api_output"
54
  output_key: "code"
55
  strip: True
56
  assert_unique: True
57
 
58
  - _target_: flows.data_transformations.EndOfInteraction
59
  end_of_interaction_string: "Final answer"
60
+ input_key: "api_output"
61
  output_key: "end_of_interaction"
62
 
63
  output_keys:
64
  - "code"
65
  - "end_of_interaction"
66
  - _target_: martinjosifoski.CC_flows.LC_CodeDebugCriticWithPlan.instantiate_from_default_config
67
+
68
+
69
+ reset_every_round:
70
+ CodeGenerator: False
71
+ CodeDebugCriticWithPlan_Flow: True
LC_CodeDebugCritic.yaml CHANGED
@@ -15,9 +15,9 @@ input_keys:
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
- raw_response.testing_results_summary: "testing_results_summary"
19
- raw_response.all_tests_passed: "all_tests_passed"
20
- raw_response.code_feedback: "code_feedback"
21
  output_keys:
22
  - "testing_results_summary"
23
  - "all_tests_passed"
 
15
  output_data_transformations:
16
  - _target_: flows.data_transformations.KeyRename
17
  old_key2new_key:
18
+ testing_results_summary: "testing_results_summary"
19
+ all_tests_passed: "all_tests_passed"
20
+ code_feedback: "code_feedback"
21
  output_keys:
22
  - "testing_results_summary"
23
  - "all_tests_passed"
LC_CodeDebugCriticWithPlan.yaml CHANGED
@@ -16,9 +16,9 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.testing_results_summary: "testing_results_summary"
20
- raw_response.all_tests_passed: "all_tests_passed"
21
- raw_response.code_feedback: "code_feedback"
22
  output_keys:
23
  - "testing_results_summary"
24
  - "all_tests_passed"
 
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
+ testing_results_summary: "testing_results_summary"
20
+ all_tests_passed: "all_tests_passed"
21
+ code_feedback: "code_feedback"
22
  output_keys:
23
  - "testing_results_summary"
24
  - "all_tests_passed"
LC_CodeReflect.yaml CHANGED
@@ -1,8 +1,6 @@
1
  name: "CodeReflect_Flow"
2
  description: "ToDO: add description"
3
 
4
- reset_generator_every_round: False
5
- reset_critic_every_round: True
6
  max_rounds: 2 # ToDo: To increase to 4
7
  early_exit_key: "end_of_interaction"
8
 
@@ -16,7 +14,7 @@ input_keys:
16
  output_data_transformations:
17
  - _target_: flows.data_transformations.KeyRename
18
  old_key2new_key:
19
- raw_response.code: "code"
20
  output_keys:
21
  - "code"
22
 
@@ -33,12 +31,14 @@ subflows_config:
33
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
34
  regex: '(?<=```python)([\s\S]*?)(?=```)'
35
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
 
36
  output_key: "code"
37
  strip: True
38
  assert_unique: True
39
 
40
  - _target_: flows.data_transformations.EndOfInteraction
41
  end_of_interaction_string: "Final answer"
 
42
  output_key: "end_of_interaction"
43
 
44
  output_keys:
@@ -46,3 +46,7 @@ subflows_config:
46
  - "end_of_interaction"
47
 
48
  - _target_: martinjosifoski.CC_flows.FixedReply_CodeReflect.instantiate_from_default_config
 
 
 
 
 
1
  name: "CodeReflect_Flow"
2
  description: "ToDO: add description"
3
 
 
 
4
  max_rounds: 2 # ToDo: To increase to 4
5
  early_exit_key: "end_of_interaction"
6
 
 
14
  output_data_transformations:
15
  - _target_: flows.data_transformations.KeyRename
16
  old_key2new_key:
17
+ code: "code"
18
  output_keys:
19
  - "code"
20
 
 
31
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
32
  regex: '(?<=```python)([\s\S]*?)(?=```)'
33
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
34
+ input_key: "api_output"
35
  output_key: "code"
36
  strip: True
37
  assert_unique: True
38
 
39
  - _target_: flows.data_transformations.EndOfInteraction
40
  end_of_interaction_string: "Final answer"
41
+ input_key: "api_output"
42
  output_key: "end_of_interaction"
43
 
44
  output_keys:
 
46
  - "end_of_interaction"
47
 
48
  - _target_: martinjosifoski.CC_flows.FixedReply_CodeReflect.instantiate_from_default_config
49
+
50
+ reset_every_round:
51
+ CodeGenerator: False
52
+ CodeReflectCritic: True
LC_CodeTesting.yaml CHANGED
@@ -12,7 +12,7 @@ output_keys:
12
  - "testing_results_summary"
13
  output_data_transformations:
14
  - _target_: .src.data_transformations.CorrectnessFlag
15
- input_key: "raw_response.public_tests_results"
16
  output_key: "all_tests_passed"
17
  - _target_: .src.data_transformations.TestingResultsSummaryGeneration
18
  output_key: "testing_results_summary"
 
12
  - "testing_results_summary"
13
  output_data_transformations:
14
  - _target_: .src.data_transformations.CorrectnessFlag
15
+ input_key: "public_tests_results"
16
  output_key: "all_tests_passed"
17
  - _target_: .src.data_transformations.TestingResultsSummaryGeneration
18
  output_key: "testing_results_summary"
LC_CodeWithPlan.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class LC_CodeWithPlan(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class LC_CodeWithPlan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_CodeWithPlan.yaml CHANGED
@@ -35,7 +35,7 @@ human_message_prompt_template:
35
  - "query"
36
  template_format: jinja2
37
 
38
- query_message_prompt_template:
39
  _target_: langchain.PromptTemplate
40
  template: |2-
41
  # Problem statement
@@ -72,7 +72,7 @@ query_message_prompt_template:
72
  template_format: jinja2
73
 
74
  input_data_transformations: []
75
- input_keys:
76
  - "problem_description"
77
  - "io_description"
78
  - "constraints"
@@ -83,6 +83,7 @@ output_data_transformations:
83
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
84
  regex: '(?<=```python)([\s\S]*?)(?=```)'
85
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
 
86
  output_key: "code"
87
  strip: True
88
  assert_unique: True
 
35
  - "query"
36
  template_format: jinja2
37
 
38
+ init_human_message_prompt_template:
39
  _target_: langchain.PromptTemplate
40
  template: |2-
41
  # Problem statement
 
72
  template_format: jinja2
73
 
74
  input_data_transformations: []
75
+ init_input_keys:
76
  - "problem_description"
77
  - "io_description"
78
  - "constraints"
 
83
  - _target_: flows.data_transformations.RegexFirstOccurrenceExtractor
84
  regex: '(?<=```python)([\s\S]*?)(?=```)'
85
  regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
86
+ input_key: "api_output"
87
  output_key: "code"
88
  strip: True
89
  assert_unique: True
LC_Plan.py CHANGED
@@ -1,5 +1,4 @@
1
- from martinjosifoski.OpenAIChatAtomicFlow import OpenAIChatAtomicFlow
2
-
3
 
4
  class LC_Plan(OpenAIChatAtomicFlow):
5
  def __init__(self, **kwargs):
 
1
+ from flows.application_flows import OpenAIChatAtomicFlow
 
2
 
3
  class LC_Plan(OpenAIChatAtomicFlow):
4
  def __init__(self, **kwargs):
LC_Plan.yaml CHANGED
@@ -13,7 +13,7 @@ generation_parameters:
13
  presence_penalty: 0
14
 
15
  input_data_transformations: []
16
- input_keys:
17
  - "problem_description"
18
  - "io_description"
19
  - "constraints"
@@ -23,6 +23,7 @@ output_data_transformations:
23
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
24
  regex_fallback:
25
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
 
26
  output_key: "plan"
27
  strip: True
28
  assert_unique: True
@@ -53,7 +54,7 @@ human_message_prompt_template:
53
  - "query"
54
  template_format: jinja2
55
 
56
- query_message_prompt_template:
57
  _target_: langchain.PromptTemplate
58
  template: |2-
59
  # Problem statement
 
13
  presence_penalty: 0
14
 
15
  input_data_transformations: []
16
+ init_input_keys:
17
  - "problem_description"
18
  - "io_description"
19
  - "constraints"
 
23
  regex: '(?<=Conceptual solution)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
24
  regex_fallback:
25
  - '(?<=Conceptual solution:)([\s\S]*?)(?=\n\n# [A-Z]|\Z)'
26
+ input_key: "api_output"
27
  output_key: "plan"
28
  strip: True
29
  assert_unique: True
 
54
  - "query"
55
  template_format: jinja2
56
 
57
+ init_human_message_prompt_template:
58
  _target_: langchain.PromptTemplate
59
  template: |2-
60
  # Problem statement