From 72e20a5dbb7fe4eb81289de19fca0b44b13a199c Mon Sep 17 00:00:00 2001 From: "Brandon Hancock (bhancock_ai)" <109994880+bhancockio@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:57:56 -0400 Subject: [PATCH] Resolved Merge Conflicts for PR #712: Remove Hyphen in co-workers (#786) * removed hyphen in co-workers * Fix issue with AgentTool agent selection. The LLM included double quotes in the agent name which messed up the string comparison. Added additional types. Cleaned up error messaging. * Remove duplicate import * Improve explanation * Revert poetry.lock changes * Fix missing line in poetry.lock --------- Co-authored-by: madmag77 --- src/crewai/agents/executor.py | 2 +- src/crewai/tools/agent_tools.py | 46 ++++++--- src/crewai/tools/tool_usage.py | 4 +- src/crewai/translations/en.json | 6 +- src/crewai/utilities/logger.py | 1 + tests/agent_tools/agent_tools_test.py | 6 +- ...t_ask_question_with_coworker_as_array.yaml | 2 +- ...uestion_with_wrong_co_worker_variable.yaml | 2 +- ...te_work_with_wrong_co_worker_variable.yaml | 2 +- ...egate_work_withwith_coworker_as_array.yaml | 2 +- ...are_captured_for_hierarchical_process.yaml | 30 +++--- ..._use_specific_tasks_output_as_context.yaml | 96 +++++++++---------- .../test_cache_hitting_between_agents.yaml | 22 ++--- .../test_crew_with_delegating_agents.yaml | 30 +++--- .../cassettes/test_hierarchical_process.yaml | 36 +++---- ..._delegations_for_hierarchical_process.yaml | 46 ++++----- .../cassettes/test_increment_tool_errors.yaml | 32 +++---- 17 files changed, 194 insertions(+), 171 deletions(-) diff --git a/src/crewai/agents/executor.py b/src/crewai/agents/executor.py index 05cc25504..5013cc6d7 100644 --- a/src/crewai/agents/executor.py +++ b/src/crewai/agents/executor.py @@ -58,7 +58,7 @@ class CrewAgentExecutor(AgentExecutor): if ( self.crew and self.crew.memory - and "Action: Delegate work to co-worker" not in output.log + and "Action: Delegate work to coworker" not in output.log ): memory = ShortTermMemoryItem( data=output.log, diff --git a/src/crewai/tools/agent_tools.py b/src/crewai/tools/agent_tools.py index 7598e9040..e3c6054f4 100644 --- a/src/crewai/tools/agent_tools.py +++ b/src/crewai/tools/agent_tools.py @@ -18,14 +18,14 @@ class AgentTools(BaseModel): tools = [ StructuredTool.from_function( func=self.delegate_work, - name="Delegate work to co-worker", + name="Delegate work to coworker", description=self.i18n.tools("delegate_work").format( coworkers=f"[{', '.join([f'{agent.role}' for agent in self.agents])}]" ), ), StructuredTool.from_function( func=self.ask_question, - name="Ask question to co-worker", + name="Ask question to coworker", description=self.i18n.tools("ask_question").format( coworkers=f"[{', '.join([f'{agent.role}' for agent in self.agents])}]" ), @@ -34,34 +34,54 @@ class AgentTools(BaseModel): return tools def delegate_work( - self, task: str, context: str, coworker: Union[str, None] = None, **kwargs + self, + task: str, + context: Union[str, None] = None, + coworker: Union[str, None] = None, + **kwargs, ): - """Useful to delegate a specific task to a co-worker passing all necessary context and names.""" - coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker") - if coworker is not None: + """Useful to delegate a specific task to a coworker passing all necessary context and names.""" + coworker = coworker or kwargs.get("co_worker") or kwargs.get("coworker") + if coworker: is_list = coworker.startswith("[") and coworker.endswith("]") if is_list: coworker = coworker[1:-1].split(",")[0] return self._execute(coworker, task, context) def ask_question( - self, question: str, context: str, coworker: Union[str, None] = None, **kwargs + self, + question: str, + context: Union[str, None] = None, + coworker: Union[str, None] = None, + **kwargs, ): - """Useful to ask a question, opinion or take from a co-worker passing all necessary context and names.""" - coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker") - if coworker is not None: + """Useful to ask a question, opinion or take from a coworker passing all necessary context and names.""" + coworker = coworker or kwargs.get("co_worker") or kwargs.get("coworker") + if coworker: is_list = coworker.startswith("[") and coworker.endswith("]") if is_list: coworker = coworker[1:-1].split(",")[0] return self._execute(coworker, question, context) - def _execute(self, agent, task, context): + def _execute(self, agent: Union[str, None], task: str, context: Union[str, None]): """Execute the command.""" try: + if agent is None: + agent = "" + + # It is important to remove the quotes from the agent name. + # The reason we have to do this is because less-powerful LLM's + # have difficulty producing valid JSON. + # As a result, we end up with invalid JSON that is truncated like this: + # {"task": "....", "coworker": ".... + # when it should look like this: + # {"task": "....", "coworker": "...."} + agent_name = agent.casefold().replace('"', "") + agent = [ available_agent for available_agent in self.agents - if available_agent.role.casefold().strip() == agent.casefold().strip() + if available_agent.role.casefold() == agent_name ] except Exception as _: return self.i18n.errors("agent_tool_unexsiting_coworker").format( @@ -81,6 +101,6 @@ class AgentTools(BaseModel): task = Task( description=task, agent=agent, - expected_output="Your best answer to your co-worker asking you this, accounting for the context shared.", + expected_output="Your best answer to your coworker asking you this, accounting for the context shared.", ) return agent.execute_task(task, context) diff --git a/src/crewai/tools/tool_usage.py b/src/crewai/tools/tool_usage.py index d4d128dbd..ce773b80b 100644 --- a/src/crewai/tools/tool_usage.py +++ b/src/crewai/tools/tool_usage.py @@ -126,8 +126,8 @@ class ToolUsage: if not result: try: if calling.tool_name in [ - "Delegate work to co-worker", - "Ask question to co-worker", + "Delegate work to coworker", + "Ask question to coworker", ]: self.task.increment_delegations() diff --git a/src/crewai/translations/en.json b/src/crewai/translations/en.json index 06e43a0a9..f3376e566 100644 --- a/src/crewai/translations/en.json +++ b/src/crewai/translations/en.json @@ -21,7 +21,7 @@ }, "errors": { "force_final_answer": "Tool won't be use because it's time to give your final answer. Don't use tools and just your absolute BEST Final answer.", - "agent_tool_unexsiting_coworker": "\nError executing tool. Co-worker mentioned not found, it must to be one of the following options:\n{coworkers}\n", + "agent_tool_unexsiting_coworker": "\nError executing tool. coworker mentioned not found, it must be one of the following options:\n{coworkers}\n", "task_repeated_usage": "I tried reusing the same input, I must stop using this action input. I'll try something else instead.\n\n", "tool_usage_error": "I encountered an error: {error}", "tool_arguments_error": "Error: the Action Input is not a valid key, value dictionary.", @@ -29,7 +29,7 @@ "tool_usage_exception": "I encountered an error while trying to use the tool. This was the error: {error}.\n Tool {tool} accepts these inputs: {tool_inputs}" }, "tools": { - "delegate_work": "Delegate a specific task to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.", - "ask_question": "Ask a specific question to one of the following co-workers: {coworkers}\nThe input to this tool should be the co-worker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them." + "delegate_work": "Delegate a specific task to one of the following coworkers: {coworkers}\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don't reference things but instead explain them.", + "ask_question": "Ask a specific question to one of the following coworkers: {coworkers}\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don't reference things but instead explain them." } } diff --git a/src/crewai/utilities/logger.py b/src/crewai/utilities/logger.py index 0e19ee5e1..e0c74d5ce 100644 --- a/src/crewai/utilities/logger.py +++ b/src/crewai/utilities/logger.py @@ -1,4 +1,5 @@ from datetime import datetime + from crewai.utilities.printer import Printer diff --git a/tests/agent_tools/agent_tools_test.py b/tests/agent_tools/agent_tools_test.py index a5914c662..1038b36ed 100644 --- a/tests/agent_tools/agent_tools_test.py +++ b/tests/agent_tools/agent_tools_test.py @@ -55,6 +55,7 @@ def test_ask_question(): == "As an AI researcher, I don't have personal feelings or emotions like love or hate. However, I recognize the importance of AI Agents in today's technological landscape. They have the potential to greatly enhance our lives and make tasks more efficient. At the same time, it is crucial to consider the ethical implications and societal impacts that come with their use. My role is to provide objective research and analysis on these topics." ) + @pytest.mark.vcr(filter_headers=["authorization"]) def test_ask_question_with_wrong_co_worker_variable(): result = tools.ask_question( @@ -68,6 +69,7 @@ def test_ask_question_with_wrong_co_worker_variable(): == "No, I don't hate AI agents. In fact, I find them quite fascinating. They are powerful tools that can greatly assist in various tasks, including my research. As a technology researcher, AI and AI agents are subjects of interest to me due to their potential in advancing our understanding and capabilities in various fields. My supposed love for them stems from this professional interest and the potential they hold." ) + @pytest.mark.vcr(filter_headers=["authorization"]) def test_delegate_work_withwith_coworker_as_array(): result = tools.delegate_work( @@ -105,7 +107,7 @@ def test_delegate_work_to_wrong_agent(): assert ( result - == "\nError executing tool. Co-worker mentioned not found, it must to be one of the following options:\n- researcher\n" + == "\nError executing tool. coworker mentioned not found, it must be one of the following options:\n- researcher\n" ) @@ -118,5 +120,5 @@ def test_ask_question_to_wrong_agent(): assert ( result - == "\nError executing tool. Co-worker mentioned not found, it must to be one of the following options:\n- researcher\n" + == "\nError executing tool. coworker mentioned not found, it must be one of the following options:\n- researcher\n" ) diff --git a/tests/agent_tools/cassettes/test_ask_question_with_coworker_as_array.yaml b/tests/agent_tools/cassettes/test_ask_question_with_coworker_as_array.yaml index b06781fec..599291317 100644 --- a/tests/agent_tools/cassettes/test_ask_question_with_coworker_as_array.yaml +++ b/tests/agent_tools/cassettes/test_ask_question_with_coworker_as_array.yaml @@ -8,7 +8,7 @@ interactions: the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: do you hate AI Agents?\n\nThis is the expect criteria for - your final answer: Your best answer to your co-worker asking you this, accounting + your final answer: Your best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nI heard you LOVE them\n\nBegin! This is VERY important to you, use the tools available diff --git a/tests/agent_tools/cassettes/test_ask_question_with_wrong_co_worker_variable.yaml b/tests/agent_tools/cassettes/test_ask_question_with_wrong_co_worker_variable.yaml index edc3f8ff7..f375846c9 100644 --- a/tests/agent_tools/cassettes/test_ask_question_with_wrong_co_worker_variable.yaml +++ b/tests/agent_tools/cassettes/test_ask_question_with_wrong_co_worker_variable.yaml @@ -200797,7 +200797,7 @@ interactions: the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: do you hate AI Agents?\n\nThis is the expect criteria for - your final answer: Your best answer to your co-worker asking you this, accounting + your final answer: Your best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nI heard you LOVE them\n\nBegin! This is VERY important to you, use the tools available diff --git a/tests/agent_tools/cassettes/test_delegate_work_with_wrong_co_worker_variable.yaml b/tests/agent_tools/cassettes/test_delegate_work_with_wrong_co_worker_variable.yaml index 670aa9b8b..a94a9e583 100644 --- a/tests/agent_tools/cassettes/test_delegate_work_with_wrong_co_worker_variable.yaml +++ b/tests/agent_tools/cassettes/test_delegate_work_with_wrong_co_worker_variable.yaml @@ -95,7 +95,7 @@ interactions: the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: share your take on AI Agents\n\nThis is the expect criteria - for your final answer: Your best answer to your co-worker asking you this, accounting + for your final answer: Your best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nI heard you hate them\n\nBegin! This is VERY important to you, use the tools available diff --git a/tests/agent_tools/cassettes/test_delegate_work_withwith_coworker_as_array.yaml b/tests/agent_tools/cassettes/test_delegate_work_withwith_coworker_as_array.yaml index d3042d4bd..cfe572f0d 100644 --- a/tests/agent_tools/cassettes/test_delegate_work_withwith_coworker_as_array.yaml +++ b/tests/agent_tools/cassettes/test_delegate_work_withwith_coworker_as_array.yaml @@ -95,7 +95,7 @@ interactions: the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: share your take on AI Agents\n\nThis is the expect criteria - for your final answer: Your best answer to your co-worker asking you this, accounting + for your final answer: Your best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nI heard you hate them\n\nBegin! This is VERY important to you, use the tools available diff --git a/tests/cassettes/test_agent_usage_metrics_are_captured_for_hierarchical_process.yaml b/tests/cassettes/test_agent_usage_metrics_are_captured_for_hierarchical_process.yaml index 62ba83f65..8d1cbc152 100644 --- a/tests/cassettes/test_agent_usage_metrics_are_captured_for_hierarchical_process.yaml +++ b/tests/cassettes/test_agent_usage_metrics_are_captured_for_hierarchical_process.yaml @@ -8,20 +8,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [Researcher]\nThe input to this tool should be the coworker, the + coworkers: [Researcher]\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference - things but instead explain them.\nAsk question to co-worker: Ask question to - co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [Researcher]\nThe input to this tool should + things but instead explain them.\nAsk question to coworker: Ask question to + coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [Researcher]\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -1027,20 +1027,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [Researcher]\nThe input to this tool should be the coworker, the + coworkers: [Researcher]\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference - things but instead explain them.\nAsk question to co-worker: Ask question to - co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [Researcher]\nThe input to this tool should + things but instead explain them.\nAsk question to coworker: Ask question to + coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [Researcher]\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -1051,7 +1051,7 @@ interactions: job depends on it!\n\nThought: \nI need to delegate the task of saying \"hi\" to the researcher. I will provide them with the context that this is a simple greeting task and they should respond with \"Howdy!\".\n\nAction: \nDelegate - work to co-worker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": + work to coworker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": \"Say hi\",\n \"context\": \"This is a simple task where you need to greet by saying ''Howdy!''. This is a common greeting in certain parts of the world, particularly in the southern United States. It''s a friendly, informal way to diff --git a/tests/cassettes/test_agent_use_specific_tasks_output_as_context.yaml b/tests/cassettes/test_agent_use_specific_tasks_output_as_context.yaml index dc9788347..a6476f5a3 100644 --- a/tests/cassettes/test_agent_use_specific_tasks_output_as_context.yaml +++ b/tests/cassettes/test_agent_use_specific_tasks_output_as_context.yaml @@ -3,19 +3,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role. test backstory\nYour personal goal is: test goal\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role2'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -323,19 +323,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role. test backstory\nYour personal goal is: test goal\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role2'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -345,23 +345,23 @@ interactions: as the final answer, not a summary.\n\nBegin! This is VERY important to you, use the tools available and give your best Final Answer, your job depends on it!\n\nThought: \nAs this task is very straightforward and doesn''t require - any input or help from my co-worker, I should go ahead and complete it myself.\n\nAction: + any input or help from my coworker, I should go ahead and complete it myself.\n\nAction: None\n\nAction Input: None\n\nObservation: I encountered an error: Action ''None'' - don''t exist, these are the only available Actions: Delegate work to co-worker: - Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate - a specific task to one of the following co-workers: [''test role2'']\nThe input + don''t exist, these are the only available Actions: Delegate work to coworker: + Delegate work to coworker(coworker: str, task: str, context: str) - Delegate + a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk - question to co-worker: Ask question to co-worker(coworker: str, question: str, - context: str) - Ask a specific question to one of the following co-workers: + question to coworker: Ask question to coworker(coworker: str, question: str, + context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\nMoving on then. I MUST either use a tool (use one at time) OR give my best final answer. To Use the following format:\n\nThought: you should always think about what to do\nAction: the action - to take, should be one of [Delegate work to co-worker, Ask question to co-worker]\nAction + to take, should be one of [Delegate work to coworker, Ask question to coworker]\nAction Input: the input to the action, dictionary\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now can give a great answer\nFinal Answer: my best complete final answer to @@ -1024,19 +1024,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role. test backstory\nYour personal goal is: test goal\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role2'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -1046,31 +1046,31 @@ interactions: as the final answer, not a summary.\n\nBegin! This is VERY important to you, use the tools available and give your best Final Answer, your job depends on it!\n\nThought: \nAs this task is very straightforward and doesn''t require - any input or help from my co-worker, I should go ahead and complete it myself.\n\nAction: + any input or help from my coworker, I should go ahead and complete it myself.\n\nAction: None\n\nAction Input: None\n\nObservation: I encountered an error: Action ''None'' - don''t exist, these are the only available Actions: Delegate work to co-worker: - Delegate work to co-worker(coworker: str, task: str, context: str) - Delegate - a specific task to one of the following co-workers: [''test role2'']\nThe input + don''t exist, these are the only available Actions: Delegate work to coworker: + Delegate work to coworker(coworker: str, task: str, context: str) - Delegate + a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk - question to co-worker: Ask question to co-worker(coworker: str, question: str, - context: str) - Ask a specific question to one of the following co-workers: + question to coworker: Ask question to coworker(coworker: str, question: str, + context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\nMoving on then. I MUST either use a tool (use one at time) OR give my best final answer. To Use the following format:\n\nThought: you should always think about what to do\nAction: the action - to take, should be one of [Delegate work to co-worker, Ask question to co-worker]\nAction + to take, should be one of [Delegate work to coworker, Ask question to coworker]\nAction Input: the input to the action, dictionary\nObservation: the result of the action\n... (this Thought/Action/Action Input/Observation can repeat N times)\nThought: I now can give a great answer\nFinal Answer: my best complete final answer to the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described\n\n \nThought: \nAlthough I initially thought that I could just say hi myself, this system seems to require me to use one of the - tools available. Therefore, I''ll delegate this task to my co-worker.\n\nAction: - Delegate work to co-worker\n\nAction Input: {\"coworker\": \"test role2\", \"task\": + tools available. Therefore, I''ll delegate this task to my coworker.\n\nAction: + Delegate work to coworker\n\nAction Input: {\"coworker\": \"test role2\", \"task\": \"Just say hi\", \"context\": \"We need to greet someone. Just say ''hi'' to them.\"}\n\nObservation: Hi there!\n"}], "model": "gpt-4", "n": 1, "stop": ["\nObservation"], "stream": true, "temperature": 0.7}' @@ -1233,19 +1233,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role. test backstory\nYour personal goal is: test goal\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role2'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role2'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -1482,19 +1482,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role2. test backstory2\nYour personal goal is: test goal2\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -2487,19 +2487,19 @@ interactions: body: '{"messages": [{"role": "user", "content": "You are test role2. test backstory2\nYour personal goal is: test goal2\n\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nDelegate work to - co-worker: Delegate work to co-worker(coworker: str, task: str, context: str) - - Delegate a specific task to one of the following co-workers: [''test role'']\nThe + coworker: Delegate work to coworker(coworker: str, task: str, context: str) + - Delegate a specific task to one of the following coworkers: [''test role'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''test role'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -2511,8 +2511,8 @@ interactions: you, use the tools available and give your best Final Answer, your job depends on it!\n\nThought: \nI need to understand the context better before I can provide a final answer. It seems I''m missing crucial information to proceed. I will - ask a question to my co-worker, ''test role'', to gather more details about - the situation.\n\nAction: \nAsk question to co-worker\n\nAction Input: \n{\"coworker\": + ask a question to my coworker, ''test role'', to gather more details about + the situation.\n\nAction: \nAsk question to coworker\n\nAction Input: \n{\"coworker\": \"test role\", \"question\": \"Could you please provide more details about the situation?\", \"context\": \"Hi there!\"}\n\nObservation: Could you please provide more details about the situation?\n"}], "model": "gpt-4", "n": 1, "stop": ["\nObservation"], diff --git a/tests/cassettes/test_cache_hitting_between_agents.yaml b/tests/cassettes/test_cache_hitting_between_agents.yaml index f915ab7fa..5ca313586 100644 --- a/tests/cassettes/test_cache_hitting_between_agents.yaml +++ b/tests/cassettes/test_cache_hitting_between_agents.yaml @@ -64,19 +64,19 @@ interactions: ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nmultiplier: multiplier(first_number: int, second_number: int) -> float - Useful for when you need to multiply two numbers together.\nDelegate - work to co-worker: Delegate work to co-worker(coworker: str, task: str, context: - str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe + work to coworker: Delegate work to coworker(coworker: str, task: str, context: + str) - Delegate a specific task to one of the following coworkers: [''Researcher'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''Researcher'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [multiplier, Delegate work to co-worker, Ask question to co-worker], + name of [multiplier, Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: @@ -439,19 +439,19 @@ interactions: ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\nmultiplier: multiplier(first_number: int, second_number: int) -> float - Useful for when you need to multiply two numbers together.\nDelegate - work to co-worker: Delegate work to co-worker(coworker: str, task: str, context: - str) - Delegate a specific task to one of the following co-workers: [''Researcher'']\nThe + work to coworker: Delegate work to coworker(coworker: str, task: str, context: + str) - Delegate a specific task to one of the following coworkers: [''Researcher'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain - them.\nAsk question to co-worker: Ask question to co-worker(coworker: str, question: - str, context: str) - Ask a specific question to one of the following co-workers: + them.\nAsk question to coworker: Ask question to coworker(coworker: str, question: + str, context: str) - Ask a specific question to one of the following coworkers: [''Researcher'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [multiplier, Delegate work to co-worker, Ask question to co-worker], + name of [multiplier, Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: @@ -463,7 +463,7 @@ interactions: Answer, your job depends on it!\n\nThought: \nThe task at hand is to find the product of 2 and 6. Since I have the tool ''multiplier'' which multiplies two numbers, I can directly use it without needing to delegate or ask questions - to a co-worker.\n\nAction: multiplier\nAction Input: {\"first_number\": 2, \"second_number\": + to a coworker.\n\nAction: multiplier\nAction Input: {\"first_number\": 2, \"second_number\": 6}\n\nObservation: 12\n"}], "model": "gpt-4", "n": 1, "stop": ["\nObservation"], "stream": true, "temperature": 0.7}' headers: diff --git a/tests/cassettes/test_crew_with_delegating_agents.yaml b/tests/cassettes/test_crew_with_delegating_agents.yaml index e7f5b9bef..e62588ca1 100644 --- a/tests/cassettes/test_crew_with_delegating_agents.yaml +++ b/tests/cassettes/test_crew_with_delegating_agents.yaml @@ -83,20 +83,20 @@ interactions: now working on a new project and want to make sure the content produced is amazing.\nYour personal goal is: Make sure the writers in your company produce amazing content.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker, + coworkers: [''Senior Writer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t - reference things but instead explain them.\nAsk question to co-worker: Ask question - to co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [''Senior Writer'']\nThe input to this tool + reference things but instead explain them.\nAsk question to coworker: Ask question + to coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [''Senior Writer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -1713,20 +1713,20 @@ interactions: now working on a new project and want to make sure the content produced is amazing.\nYour personal goal is: Make sure the writers in your company produce amazing content.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Senior Writer'']\nThe input to this tool should be the coworker, + coworkers: [''Senior Writer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t - reference things but instead explain them.\nAsk question to co-worker: Ask question - to co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [''Senior Writer'']\nThe input to this tool + reference things but instead explain them.\nAsk question to coworker: Ask question + to coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [''Senior Writer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -1738,7 +1738,7 @@ interactions: it!\n\nThought: \nI want to ensure that the Senior Writer understands the topic and the standard of quality that we aim to achieve. I''ll provide them with all the information they need to produce an amazing 1 paragraph draft about - AI Agents. \n\nAction: Delegate work to co-worker\nAction Input: {\"coworker\": + AI Agents. \n\nAction: Delegate work to coworker\nAction Input: {\"coworker\": \"Senior Writer\", \"task\": \"Produce a 1 paragraph draft of an article about AI Agents.\", \"context\": \"We are working on a new project that requires high-quality content about AI Agents. We want to make sure that the content is engaging, diff --git a/tests/cassettes/test_hierarchical_process.yaml b/tests/cassettes/test_hierarchical_process.yaml index cdf77bf45..7ddba4b11 100644 --- a/tests/cassettes/test_hierarchical_process.yaml +++ b/tests/cassettes/test_hierarchical_process.yaml @@ -63,20 +63,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should + coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(coworker: str, question: str, context: - str) - Ask a specific question to one of the following co-workers: [''Researcher'', + coworker: Ask question to coworker(coworker: str, question: str, context: + str) - Ask a specific question to one of the following coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -2444,20 +2444,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should + coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(coworker: str, question: str, context: - str) - Ask a specific question to one of the following co-workers: [''Researcher'', + coworker: Ask question to coworker(coworker: str, question: str, context: + str) - Ask a specific question to one of the following coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -2474,7 +2474,7 @@ interactions: a paragraph for each idea that showcases how good an article about this topic could be. I will delegate the task of coming up with the ideas to the Researcher and the task of writing the paragraphs to the Senior Writer.\n\nAction: \nDelegate - work to co-worker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": + work to coworker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": \"Come up with 5 interesting ideas for an article\",\n \"context\": \"We need to create a list of 5 interesting ideas for an article. These ideas should be unique, engaging, and have the potential to be developed into a full-length @@ -5363,20 +5363,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should + coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(coworker: str, question: str, context: - str) - Ask a specific question to one of the following co-workers: [''Researcher'', + coworker: Ask question to coworker(coworker: str, question: str, context: + str) - Ask a specific question to one of the following coworkers: [''Researcher'', ''Senior Writer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now @@ -5393,7 +5393,7 @@ interactions: a paragraph for each idea that showcases how good an article about this topic could be. I will delegate the task of coming up with the ideas to the Researcher and the task of writing the paragraphs to the Senior Writer.\n\nAction: \nDelegate - work to co-worker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": + work to coworker\n\nAction Input: \n{\n \"coworker\": \"Researcher\",\n \"task\": \"Come up with 5 interesting ideas for an article\",\n \"context\": \"We need to create a list of 5 interesting ideas for an article. These ideas should be unique, engaging, and have the potential to be developed into a full-length @@ -5406,7 +5406,7 @@ interactions: for the article. Now, I need to delegate the task of writing a paragraph for each idea to the Senior Writer. I will provide the Senior Writer with the ideas and ask them to write a paragraph that showcases how good an article about each - topic could be.\n\nAction: \nDelegate work to co-worker\n\nAction Input: \n{\n \"coworker\": + topic could be.\n\nAction: \nDelegate work to coworker\n\nAction Input: \n{\n \"coworker\": \"Senior Writer\",\n \"task\": \"Write one amazing paragraph highlight for each idea\",\n \"context\": \"We have 5 interesting ideas for an article. They are: 1. ''Demystifying AI: An in-depth exploration of Artificial Intelligence diff --git a/tests/cassettes/test_increment_delegations_for_hierarchical_process.yaml b/tests/cassettes/test_increment_delegations_for_hierarchical_process.yaml index 8ace91aaa..316f31dfa 100644 --- a/tests/cassettes/test_increment_delegations_for_hierarchical_process.yaml +++ b/tests/cassettes/test_increment_delegations_for_hierarchical_process.yaml @@ -144,20 +144,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(task: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(task: str, context: str, coworker: Optional[str] = None, **kwargs) - Delegate a specific - task to one of the following co-workers: [Scorer]\nThe input to this tool should - be the co-worker, the task you want them to do, and ALL necessary context to + task to one of the following coworkers: [Scorer]\nThe input to this tool should + be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(question: str, context: str, coworker: + coworker: Ask question to coworker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following - co-workers: [Scorer]\nThe input to this tool should be the co-worker, the question + coworkers: [Scorer]\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: @@ -1391,7 +1391,7 @@ interactions: it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: What criteria do you use to score a title and how are these criteria weighted?\n\nThis is the expect criteria for your final answer: Your - best answer to your co-worker asking you this, accounting for the context shared. + best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nI need to assign a score between 1-5 to the title ''The impact of AI in the future of work.'' To ensure I understand @@ -3120,20 +3120,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(task: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(task: str, context: str, coworker: Optional[str] = None, **kwargs) - Delegate a specific - task to one of the following co-workers: [Scorer]\nThe input to this tool should - be the co-worker, the task you want them to do, and ALL necessary context to + task to one of the following coworkers: [Scorer]\nThe input to this tool should + be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(question: str, context: str, coworker: + coworker: Ask question to coworker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following - co-workers: [Scorer]\nThe input to this tool should be the co-worker, the question + coworkers: [Scorer]\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: @@ -3149,7 +3149,7 @@ interactions: contribute to a title''s score and how these factors are weighted. Given I can''t make assumptions and have to provide all necessary context, I need to first gather this information to ensure the task is completed accurately.\n\nAction: - Ask question to co-worker\n\nAction Input: {\"question\": \"What criteria do + Ask question to coworker\n\nAction Input: {\"question\": \"What criteria do you use to score a title and how are these criteria weighted?\", \"context\": \"I need to assign a score between 1-5 to the title ''The impact of AI in the future of work.'' To ensure I understand how to evaluate this title accurately, @@ -4438,7 +4438,7 @@ interactions: the task.\nYour final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!\nCurrent Task: Score the title using the provided criteria\n\nThis is the - expect criteria for your final answer: Your best answer to your co-worker asking + expect criteria for your final answer: Your best answer to your coworker asking you this, accounting for the context shared. \n you MUST return the actual complete content as the final answer, not a summary.\n\nThis is the context you''re working with:\nThe title to be scored is ''The impact of AI in the future of work.'' @@ -4936,20 +4936,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(task: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(task: str, context: str, coworker: Optional[str] = None, **kwargs) - Delegate a specific - task to one of the following co-workers: [Scorer]\nThe input to this tool should - be the co-worker, the task you want them to do, and ALL necessary context to + task to one of the following coworkers: [Scorer]\nThe input to this tool should + be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference things but instead explain them.\nAsk question to - co-worker: Ask question to co-worker(question: str, context: str, coworker: + coworker: Ask question to coworker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following - co-workers: [Scorer]\nThe input to this tool should be the co-worker, the question + coworkers: [Scorer]\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: the action to take, only one - name of [Delegate work to co-worker, Ask question to co-worker], just the name, + name of [Delegate work to coworker, Ask question to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: @@ -4965,7 +4965,7 @@ interactions: contribute to a title''s score and how these factors are weighted. Given I can''t make assumptions and have to provide all necessary context, I need to first gather this information to ensure the task is completed accurately.\n\nAction: - Ask question to co-worker\n\nAction Input: {\"question\": \"What criteria do + Ask question to coworker\n\nAction Input: {\"question\": \"What criteria do you use to score a title and how are these criteria weighted?\", \"context\": \"I need to assign a score between 1-5 to the title ''The impact of AI in the future of work.'' To ensure I understand how to evaluate this title accurately, @@ -4997,7 +4997,7 @@ interactions: impact of AI in the future of work\" based on Relevance, Clarity, Originality, Engagement, and Length. Given my understanding of the title''s subject and the criteria provided, I can now delegate the task of scoring the title using these - specific guidelines.\n\nAction: Delegate work to co-worker\n\nAction Input: + specific guidelines.\n\nAction: Delegate work to coworker\n\nAction Input: {\"task\": \"Score the title using the provided criteria\", \"context\": \"The title to be scored is ''The impact of AI in the future of work.'' Based on our scoring system, please evaluate the title against the following five criteria, diff --git a/tests/cassettes/test_increment_tool_errors.yaml b/tests/cassettes/test_increment_tool_errors.yaml index 4e0018f02..fba173e6b 100644 --- a/tests/cassettes/test_increment_tool_errors.yaml +++ b/tests/cassettes/test_increment_tool_errors.yaml @@ -57,20 +57,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the + coworkers: [''Scorer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference - things but instead explain them.\nAsk question to co-worker: Ask question to - co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [''Scorer'']\nThe input to this tool should + things but instead explain them.\nAsk question to coworker: Ask question to + coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [''Scorer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -3197,20 +3197,20 @@ interactions: allows you to properly evaluate the work of your team members.\nYour personal goal is: Manage the team to complete the task in the best way possible.\n\nYou ONLY have access to the following tools, and should NEVER make up tools that - are not listed here:\n\nDelegate work to co-worker: Delegate work to co-worker(coworker: + are not listed here:\n\nDelegate work to coworker: Delegate work to coworker(coworker: str, task: str, context: str) - Delegate a specific task to one of the following - co-workers: [''Scorer'']\nThe input to this tool should be the coworker, the + coworkers: [''Scorer'']\nThe input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolute everything you know, don''t reference - things but instead explain them.\nAsk question to co-worker: Ask question to - co-worker(coworker: str, question: str, context: str) - Ask a specific question - to one of the following co-workers: [''Scorer'']\nThe input to this tool should + things but instead explain them.\nAsk question to coworker: Ask question to + coworker(coworker: str, question: str, context: str) - Ask a specific question + to one of the following coworkers: [''Scorer'']\nThe input to this tool should be the coworker, the question you have for them, and ALL necessary context to ask the question properly, they know nothing about the question, so share absolute everything you know, don''t reference things but instead explain them.\n\nUse the following format:\n\nThought: you should always think about what to do\nAction: - the action to take, only one name of [Delegate work to co-worker, Ask question - to co-worker], just the name, exactly as it''s written.\nAction Input: the input + the action to take, only one name of [Delegate work to coworker, Ask question + to coworker], just the name, exactly as it''s written.\nAction Input: the input to the action, just a simple a python dictionary using \" to wrap keys and values.\nObservation: the result of the action\n\nOnce all necessary information is gathered:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original @@ -3225,8 +3225,8 @@ interactions: it. Since scoring can be subjective, it''s essential to establish clear criteria based on relevance, insightfulness, current interest in the topic, and perhaps its specificity or ability to provoke thought. As I don''t have direct guidelines, - I will need to consult with my co-worker, Scorer, who might have a set of criteria - or insights on how to approach this task.\n\nAction: Ask question to co-worker\nAction + I will need to consult with my coworker, Scorer, who might have a set of criteria + or insights on how to approach this task.\n\nAction: Ask question to coworker\nAction Input: {\"coworker\": \"Scorer\", \"question\": \"What criteria should we use to evaluate and score the title ''The impact of AI in the future of work''?\", \"context\": \"We need to assign a score between 1-5 for the title ''The impact