martinjosifoski commited on
Commit
4ae94c2
1 Parent(s): aa13514

Add config.

Browse files
Files changed (1) hide show
  1. DirectCode.yaml +76 -0
DirectCode.yaml ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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