From e2badaa4c6a9cc6ab1cd133084da6bdb847bf405 Mon Sep 17 00:00:00 2001 From: Stephen Hankinson Date: Mon, 14 Oct 2024 17:30:05 -0300 Subject: [PATCH 1/4] Use a slice for the manager request. Make the task use the agent i18n settings (#1446) --- src/crewai/agents/agent_builder/utilities/base_agent_tool.py | 3 ++- src/crewai/translations/en.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/crewai/agents/agent_builder/utilities/base_agent_tool.py b/src/crewai/agents/agent_builder/utilities/base_agent_tool.py index 556873f390..fef4ee9ef8 100644 --- a/src/crewai/agents/agent_builder/utilities/base_agent_tool.py +++ b/src/crewai/agents/agent_builder/utilities/base_agent_tool.py @@ -81,6 +81,7 @@ def _execute( task_with_assigned_agent = Task( # type: ignore # Incompatible types in assignment (expression has type "Task", variable has type "str") description=task, agent=agent, - expected_output="Your best answer to your coworker asking you this, accounting for the context shared.", + expected_output=agent.i18n.slice("manager_request"), + i18n=agent.i18n, ) return agent.execute_task(task_with_assigned_agent, context) diff --git a/src/crewai/translations/en.json b/src/crewai/translations/en.json index e3b858ca53..aad49ff5f6 100644 --- a/src/crewai/translations/en.json +++ b/src/crewai/translations/en.json @@ -20,7 +20,8 @@ "getting_input": "This is the agent's final answer: {final_answer}\n\n", "summarizer_system_message": "You are a helpful assistant that summarizes text.", "sumamrize_instruction": "Summarize the following text, make sure to include all the important information: {group}", - "summary": "This is a summary of our conversation so far:\n{merged_summary}" + "summary": "This is a summary of our conversation so far:\n{merged_summary}", + "manager_request": "Your best answer to your coworker asking you this, accounting for the context shared." }, "errors": { "force_final_answer_error": "You can't keep going, this was the best you could do.\n {formatted_answer.text}", From de5d2eaa9b12167ea14ecf59c70f59227fd63fe3 Mon Sep 17 00:00:00 2001 From: Muhammad Noman Fareed <60171953+shnoman97@users.noreply.github.com> Date: Tue, 15 Oct 2024 01:30:31 +0500 Subject: [PATCH 2/4] Fix Cache Typo in Documentation (#1441) --- docs/concepts/agents.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/agents.mdx b/docs/concepts/agents.mdx index 16518e6263..f7e97f1861 100644 --- a/docs/concepts/agents.mdx +++ b/docs/concepts/agents.mdx @@ -33,7 +33,7 @@ Think of an agent as a member of a team, with specific skills and a particular j | **Verbose** *(optional)* | `verbose` | Setting this to `True` configures the internal logger to provide detailed execution logs, aiding in debugging and monitoring. Default is `False`. | | **Allow Delegation** *(optional)* | `allow_delegation` | Agents can delegate tasks or questions to one another, ensuring that each task is handled by the most suitable agent. Default is `False`. | **Step Callback** *(optional)* | `step_callback` | A function that is called after each step of the agent. This can be used to log the agent's actions or to perform other operations. It will overwrite the crew `step_callback`. | -| gbv vbn zzdsxcdsdfc**Cache** *(optional)* | `cache` | Indicates if the agent should use a cache for tool usage. Default is `True`. | +| **Cache** *(optional)* | `cache` | Indicates if the agent should use a cache for tool usage. Default is `True`. | | **System Template** *(optional)* | `system_template` | Specifies the system format for the agent. Default is `None`. | | **Prompt Template** *(optional)* | `prompt_template` | Specifies the prompt format for the agent. Default is `None`. | | **Response Template** *(optional)* | `response_template` | Specifies the response format for the agent. Default is `None`. | From ef21da15e61c84b5eafa655c8b517fe6c0125e92 Mon Sep 17 00:00:00 2001 From: Stephen Hankinson Date: Mon, 14 Oct 2024 17:49:16 -0300 Subject: [PATCH 3/4] Correct the role for the message being added to the messages list (#1438) Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com> --- src/crewai/agents/crew_agent_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crewai/agents/crew_agent_executor.py b/src/crewai/agents/crew_agent_executor.py index d15c80732e..0c510ef712 100644 --- a/src/crewai/agents/crew_agent_executor.py +++ b/src/crewai/agents/crew_agent_executor.py @@ -151,7 +151,7 @@ def _invoke_loop(self, formatted_answer=None): ) self.have_forced_answer = True self.messages.append( - self._format_msg(formatted_answer.text, role="user") + self._format_msg(formatted_answer.text, role="assistant") ) except OutputParserException as e: From 725d159e443f3d4bb4bfb290d17c80b8d9d31da4 Mon Sep 17 00:00:00 2001 From: dbubel <50341559+dbubel@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:51:04 -0400 Subject: [PATCH 4/4] fix typo in template file (#1432) --- src/crewai/cli/templates/crew/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crewai/cli/templates/crew/main.py b/src/crewai/cli/templates/crew/main.py index 86beeeacab..a20125637d 100644 --- a/src/crewai/cli/templates/crew/main.py +++ b/src/crewai/cli/templates/crew/main.py @@ -2,7 +2,7 @@ import sys from {{folder_name}}.crew import {{crew_name}}Crew -# This main file is intended to be a way for your to run your +# This main file is intended to be a way for you to run your # crew locally, so refrain from adding necessary logic into this file. # Replace with inputs you want to test with, it will automatically # interpolate any tasks and agents information