Skip to content

Commit f887d9b

Browse files
committed
Small updates to the code formatting
1 parent d6c60f8 commit f887d9b

File tree

2 files changed

+34
-38
lines changed

2 files changed

+34
-38
lines changed

crewai/agent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def execute_task(
101101
)["output"]
102102

103103
def set_cache_handler(self, cache_handler) -> None:
104-
print(f"cache_handler: {cache_handler}")
105104
self.cache_handler = cache_handler
106105
self.tools_handler = ToolsHandler(cache=self.cache_handler)
107106
self.__create_agent_executor()

crewai/prompts.py

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,76 +12,73 @@ class Prompts(BaseModel):
1212

1313
TASK_SLICE: ClassVar[str] = dedent(
1414
"""\
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!
1616
17-
Current Task: {input}
18-
{agent_scratchpad}
19-
"""
17+
Current Task: {input}"""
2018
)
2119

20+
SCRATCHPAD_SLICE: ClassVar[str] = "\n{agent_scratchpad}"
21+
2222
MEMORY_SLICE: ClassVar[str] = dedent(
2323
"""\
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}"""
2726
)
2827

2928
ROLE_PLAYING_SLICE: ClassVar[str] = dedent(
3029
"""\
31-
You are {role}.
32-
{backstory}
30+
You are {role}.
31+
{backstory}
3332
34-
Your personal goal is: {goal}
35-
"""
33+
Your personal goal is: {goal}"""
3634
)
3735

3836
TOOLS_SLICE: ClassVar[str] = dedent(
3937
"""\
4038
41-
TOOLS:
42-
------
43-
You have access to the following tools:
4439
45-
{tools}
40+
TOOLS:
41+
------
42+
You have access to the following tools:
43+
44+
{tools}
4645
47-
To use a tool, please use the exact following format:
46+
To use a tool, please use the exact following format:
4847
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+
```
5554
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:
5756
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+
```"""
6361
)
6462

6563
VOTING_SLICE: ClassVar[str] = dedent(
6664
"""\
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.
6866
69-
These are your format instructions:
70-
{format_instructions}
67+
These are your format instructions:
68+
{format_instructions}
7169
72-
These are your co-workers and their roles:
73-
{coworkers}
74-
"""
70+
These are your co-workers and their roles:
71+
{coworkers}"""
7572
)
7673

7774
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
7976
)
8077

8178
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
8380
)
8481

8582
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
8784
)

0 commit comments

Comments
 (0)