martinjosifoski
commited on
Commit
·
2719b23
1
Parent(s):
f5891e6
Remove instantiated version, and minor updates.
Browse files
DirectCode_inherited.py → DirectCode.py
RENAMED
@@ -1,7 +1,8 @@
|
|
1 |
from flows.flow_verse import load_class
|
2 |
OpenAIChatAtomicFlow = load_class("martinjosifoski/OpenAIChatAtomicFlow", "OpenAIChatAtomicFlow")
|
|
|
3 |
|
4 |
|
5 |
-
class
|
6 |
def __init__(self, **kwargs):
|
7 |
super().__init__(**kwargs)
|
|
|
1 |
from flows.flow_verse import load_class
|
2 |
OpenAIChatAtomicFlow = load_class("martinjosifoski/OpenAIChatAtomicFlow", "OpenAIChatAtomicFlow")
|
3 |
+
# OpenAIChatAtomicFlow = load_class("/Users/josifosk/Documents/PhD/OpenAIChatAtomicFlow", "OpenAIChatAtomicFlow")
|
4 |
|
5 |
|
6 |
+
class DirectCode(OpenAIChatAtomicFlow):
|
7 |
def __init__(self, **kwargs):
|
8 |
super().__init__(**kwargs)
|
DirectCode_inherited.yaml → DirectCode.yaml
RENAMED
File without changes
|
DirectCode_instantiated.py
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
from flows.flow_verse import load_class
|
2 |
-
OpenAIChatAtomicFlow = load_class("martinjosifoski/OpenAIChatAtomicFlow", "OpenAIChatAtomicFlow")
|
3 |
-
|
4 |
-
|
5 |
-
class DirectCode_instantiated:
|
6 |
-
@classmethod
|
7 |
-
def instantiate(cls, config):
|
8 |
-
return OpenAIChatAtomicFlow(**config)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DirectCode_instantiated.yaml
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
name: "CodeAgent"
|
2 |
-
verbose: True
|
3 |
-
description: "ToDO: add description"
|
4 |
-
|
5 |
-
model_name: "gpt-4"
|
6 |
-
generation_parameters:
|
7 |
-
n: 1
|
8 |
-
max_tokens: 3000
|
9 |
-
temperature: 0.3
|
10 |
-
|
11 |
-
model_kwargs:
|
12 |
-
top_p: 0.2
|
13 |
-
frequency_penalty: 0
|
14 |
-
presence_penalty: 0
|
15 |
-
|
16 |
-
system_message_prompt_template:
|
17 |
-
_target_: langchain.PromptTemplate
|
18 |
-
template: |2-
|
19 |
-
Your goal is to provide executable Python code that solves a competitive programming problem. The code should correctly handle all corner cases in order to pass the hidden test cases, which are used to evaluate the correctness of the solution.
|
20 |
-
|
21 |
-
The user will specify the problem by providing you with:
|
22 |
-
- the problem statement
|
23 |
-
- input description
|
24 |
-
- output description
|
25 |
-
- example test cases
|
26 |
-
- (optional) explanation of the test cases
|
27 |
-
|
28 |
-
The user will provide you with a task and an output format that you will strictly follow.
|
29 |
-
input_variables: []
|
30 |
-
template_format: jinja2
|
31 |
-
|
32 |
-
human_message_prompt_template:
|
33 |
-
_target_: langchain.PromptTemplate
|
34 |
-
template: "{{query}}"
|
35 |
-
input_variables:
|
36 |
-
- "query"
|
37 |
-
template_format: jinja2
|
38 |
-
|
39 |
-
query_message_prompt_template:
|
40 |
-
_target_: langchain.PromptTemplate
|
41 |
-
template: |2-
|
42 |
-
# Problem statement
|
43 |
-
{{problem_description}}
|
44 |
-
|
45 |
-
# Input description
|
46 |
-
{{input_description}}
|
47 |
-
|
48 |
-
# Output description
|
49 |
-
{{output_description}}
|
50 |
-
|
51 |
-
{{io_examples_and_explanation}}
|
52 |
-
|
53 |
-
|
54 |
-
The input should be read from the standard input and the output should be passed to the standard output.
|
55 |
-
Return Python code that solves the problem. Reply in the following format:
|
56 |
-
```python
|
57 |
-
{{code_placeholder}}
|
58 |
-
```
|
59 |
-
input_variables:
|
60 |
-
- "problem_description"
|
61 |
-
- "input_description"
|
62 |
-
- "output_description"
|
63 |
-
- "io_examples_and_explanation"
|
64 |
-
partial_variables:
|
65 |
-
code_placeholder: "{{python_code}}"
|
66 |
-
template_format: jinja2
|
67 |
-
|
68 |
-
response_annotators:
|
69 |
-
code_extractor:
|
70 |
-
_target_: flows.message_annotators.RegexFirstOccurrenceExtractor
|
71 |
-
regex: '(?<=```python)([\s\S]*?)(?=```)'
|
72 |
-
regex_fallback: '(?<=```)([\s\S]*?)(?=```)'
|
73 |
-
key: code
|
74 |
-
strip: True
|
75 |
-
assert_unique: True
|
76 |
-
verbose: True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__init__.py
CHANGED
@@ -1,3 +1 @@
|
|
1 |
-
from .
|
2 |
-
from .DirectCode_instantiated import DirectCode_instantiated
|
3 |
-
|
|
|
1 |
+
from .DirectCode import DirectCode
|
|
|
|