File size: 2,559 Bytes
c21b758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c4a97b
c21b758
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c4a97b
c21b758
 
 
 
 
 
 
 
 
 
ae49f4f
c21b758
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: "CodeCriticWrongAttempt_Flow"
description: "ToDO: add description"

model_name: "gpt-4"
generation_parameters:
  n: 1
  max_tokens: 3000
  temperature: 0.3

  model_kwargs:
    top_p: 0.2
    frequency_penalty: 0
    presence_penalty: 0

system_message_prompt_template:
  _target_: langchain.PromptTemplate
  template: |2-
    Your goal is to identify the issues with an incorrect competitive programming solution attempt.
  
    The user will specify the problem by providing you with:
      - the problem statement
      - input description
      - output description
      - example test cases
      - (optional) explanation of the test cases
      - an incorrect Python solution attempt and a description of its issue
  
    Crucially, your goal is to consider all aspects of the problem and pinpoint the issues with the solution attempt, and not to provide the code implementation yourself.
    Some aspects to consider: Is the input correctly parsed? Is the output correctly formatted? Are the corner cases correctly handled? Is there a logical mistake with the algorithm itself?
    Use the code execution results provided in the issue description to guide your reasoning/debugging.
  input_variables: []
  template_format: jinja2

human_message_prompt_template:
  _target_: langchain.PromptTemplate
  template: "{{query}}"
  input_variables:
    - "query"
  template_format: jinja2

init_human_message_prompt_template:
  _target_: langchain.PromptTemplate
  template: |2-
    # Problem statement
    {{problem_description}}

    # Input description
    {{input_description}}

    # Output description
    {{output_description}}

    {{io_examples_and_explanation}}

    # Solution attempt to be fixed
    ```python
    {{code}}
    ```

    {{testing_results_summary}}


    Consider the problem statement, the solution attempt and the issue. Why is the solution attempt incorrect? How should it be fixed? Explain your reasoning very concisely, and do not provide code.
  input_variables:
    - "problem_description"
    - "input_description"
    - "output_description"
    - "io_examples_and_explanation"
    - "code"
    - "testing_results_summary"
  template_format: jinja2

input_data_transformations: []
init_input_keys:
  - "problem_description"
  - "input_description"
  - "output_description"
  - "io_examples_and_explanation"
  - "testing_results_summary"
  - "code"

output_data_transformations:
  - _target_: flows.data_transformations.KeyRename
    old_key2new_key:
      api_output: "code_feedback"
output_keys:
  - "code_feedback"