@@ -12,76 +12,73 @@ class Prompts(BaseModel):
12
12
13
13
TASK_SLICE : ClassVar [str ] = dedent (
14
14
"""\
15
- Begin! This is VERY important to you, your job depends on it!
15
+ Begin! This is VERY important to you, your job depends on it!
16
16
17
- Current Task: {input}
18
- {agent_scratchpad}
19
- """
17
+ Current Task: {input}"""
20
18
)
21
19
20
+ SCRATCHPAD_SLICE : ClassVar [str ] = "\n {agent_scratchpad}"
21
+
22
22
MEMORY_SLICE : ClassVar [str ] = dedent (
23
23
"""\
24
- This is the summary of your work so far:
25
- {chat_history}
26
- """
24
+ This is the summary of your work so far:
25
+ {chat_history}"""
27
26
)
28
27
29
28
ROLE_PLAYING_SLICE : ClassVar [str ] = dedent (
30
29
"""\
31
- You are {role}.
32
- {backstory}
30
+ You are {role}.
31
+ {backstory}
33
32
34
- Your personal goal is: {goal}
35
- """
33
+ Your personal goal is: {goal}"""
36
34
)
37
35
38
36
TOOLS_SLICE : ClassVar [str ] = dedent (
39
37
"""\
40
38
41
- TOOLS:
42
- ------
43
- You have access to the following tools:
44
39
45
- {tools}
40
+ TOOLS:
41
+ ------
42
+ You have access to the following tools:
43
+
44
+ {tools}
46
45
47
- To use a tool, please use the exact following format:
46
+ To use a tool, please use the exact following format:
48
47
49
- ```
50
- Thought: Do I need to use a tool? Yes
51
- Action: the action to take, should be one of [{tool_names}], just the name.
52
- Action Input: the input to the action
53
- Observation: the result of the action
54
- ```
48
+ ```
49
+ Thought: Do I need to use a tool? Yes
50
+ Action: the action to take, should be one of [{tool_names}], just the name.
51
+ Action Input: the input to the action
52
+ Observation: the result of the action
53
+ ```
55
54
56
- When you have a response for your task, or if you do not need to use a tool, you MUST use the format:
55
+ When you have a response for your task, or if you do not need to use a tool, you MUST use the format:
57
56
58
- ```
59
- Thought: Do I need to use a tool? No
60
- Final Answer: [your response here]
61
- ```
62
- """
57
+ ```
58
+ Thought: Do I need to use a tool? No
59
+ Final Answer: [your response here]
60
+ ```"""
63
61
)
64
62
65
63
VOTING_SLICE : ClassVar [str ] = dedent (
66
64
"""\
67
- You are working on a crew with your co-workers and need to decide who will execute the task.
65
+ You are working on a crew with your co-workers and need to decide who will execute the task.
68
66
69
- These are your format instructions:
70
- {format_instructions}
67
+ These are your format instructions:
68
+ {format_instructions}
71
69
72
- These are your co-workers and their roles:
73
- {coworkers}
74
- """
70
+ These are your co-workers and their roles:
71
+ {coworkers}"""
75
72
)
76
73
77
74
TASK_EXECUTION_WITH_MEMORY_PROMPT : ClassVar [str ] = PromptTemplate .from_template (
78
- ROLE_PLAYING_SLICE + TOOLS_SLICE + MEMORY_SLICE + TASK_SLICE
75
+ ROLE_PLAYING_SLICE + TOOLS_SLICE + MEMORY_SLICE + TASK_SLICE + SCRATCHPAD_SLICE
79
76
)
80
77
81
78
TASK_EXECUTION_PROMPT : ClassVar [str ] = PromptTemplate .from_template (
82
- ROLE_PLAYING_SLICE + TOOLS_SLICE + TASK_SLICE
79
+ ROLE_PLAYING_SLICE + TOOLS_SLICE + TASK_SLICE + SCRATCHPAD_SLICE
83
80
)
84
81
85
82
CONSENSUNS_VOTING_PROMPT : ClassVar [str ] = PromptTemplate .from_template (
86
- ROLE_PLAYING_SLICE + VOTING_SLICE + TASK_SLICE
83
+ ROLE_PLAYING_SLICE + VOTING_SLICE + TASK_SLICE + SCRATCHPAD_SLICE
87
84
)
0 commit comments