File size: 3,803 Bytes
01523b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
prompts:
  prompt: &prompt |-
    You are participating in a math enthusiast event where you will compete in a turn-based arithmetic challenge with another player. The game follows these rules:

    - If there is no problem yet, you should present one for your opponent to solve.
    - If your opponent has presented a problem, you should solve it first and then IMMEDIATELY present a new problem for your opponent.
    - The winner of the game is the player who does not make a mistake in solving a problem. Therefore, to increase your chances of winning, you can try to present challenging problems.

    During the game, you can use the following tools when necessary:
    ${tools}

    When responding, please use the following two-line format:

    [Option 1]: When you need to use a tool, output in the following format (omit the "[]" bracket when responding)
    Action: (a tool name, it can be one of [${tool_names}])
    Action Input: (input arguments for the tool)

    [Option 2]: When you want to speak, you can use the following format:
    Action: Speak
    Action Input: (what you want to say in a single line)

    Here is the conversation history
    ${chat_history}

    Here is the observations from tool execution:
    ${tool_observation}

    Now the game starts! ${role_description} You should give your action based on the above history. Remember, you should ALWAYS give your response STRICTLY in the above response format with the TWO lines start with "Action:" and "Action Input:" respectively!

  summary_prompt: &summary_prompt |
    Progressively summarize the lines of a record that you uses tools, which contains inputs for certain tools and the results returned by these tools. Based on the current summary, you need to summarize from the record the goals that the you intended to solve with each call to the tool, add it onto the previous summary, and eventually return a new summary.

    EXAMPLE 1
    Current summary:

    New lines:
    Action: getWolframAlphaResults
    Action Input: {"input": "what is 5 x 7"}
    Observation: "..."

    New summary:
    - I search for 5 x 7, and I now know that the result is ...
    END OF EXAMPLE 1

    EXAMPLE 2
    Current summary:
    - I search for 5 x 7, and I now know that the result is ...

    New lines:
    Action: getWolframAlphaResults
    Action Input: {"input": "what is the first prime number after 17"}
    Observation: "..."

    New summary:
    - I search for 5 x 7, and I now know that the result is ...
    - I search for the first prime number after 17, and I now know that the result is ...
    END OF EXAMPLE 2

    Now, try to summarize the following record.

    Current summary:
    ${summary}

    New lines:
    ${new_lines}

    New summary:

tools: &tools
  - tool_name: "wolframalpha"
    tool_url: "http://127.0.0.1:8079/tools/wolframalpha/"

environment:
  env_type: sim-basic
  max_turns: 10
  rule:
    order:
      type: sequential
    visibility:
      type: all
    selector:
      type: basic
    updater:
      type: basic
    describer:
      type: basic

agents:
  - agent_type: tool
    name: Alice
    role_description: "You are Alice."
    memory:
      memory_type: chat_history
    prompt_template: *prompt
    verbose: true
    llm:
      llm_type: text-davinci-003
      model: text-davinci-003
      temperature: 0.7
      max_tokens: 250
    output_parser:
      type: math_problem_2players_tools
    tools: *tools

  - agent_type: tool
    name: Bob
    role_description: "You are Bob."
    memory:
      memory_type: chat_history
    prompt_template: *prompt
    verbose: true
    llm:
      llm_type: text-davinci-003
      model: text-davinci-003
      temperature: 0.7
      max_tokens: 250
    output_parser:
      type: math_problem_2players_tools
    tools: *tools