crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Fix #620

Open italovieira opened this issue 9 months ago • 7 comments

By investigating I noticed using crewAI with ollama + ollama3 that in some cases the agent parameter below comes with leading or trailing quote like agent = '"pilot'. There is a code to reproduce the bug in the description of #620. https://github.com/joaomdmoura/crewAI/blob/1e112fa50a27e13dd471feca5543932f46aa5176/src/crewai/tools/agent_tools.py#L52

This causes the comparison below to be false raising the error "Co-worker mentioned not found...". https://github.com/joaomdmoura/crewAI/blob/1e112fa50a27e13dd471feca5543932f46aa5176/src/crewai/tools/agent_tools.py#L58

I think this is the reason there was a .strip(") at https://github.com/joaomdmoura/crewAI/blob/bcb57ce5f9b359d933870f66634109ce269989c1/src/crewai/tools/tool_usage.py#L354 So I've added back to fix #620.

italovieira avatar May 15 '24 11:05 italovieira

I'm having the same issue and would love to see this merged.

rundeks avatar May 19 '24 23:05 rundeks

I am seeing something similar when using Ollama with various models

llama3

Error executing tool. Co-worker mentioned not found, it must to be one of the following options:
- editor
- newsfetcher
- newsanalyzer
- newslettercompiler

mistral

Action 'Delegate work to newsfetcher' don't exist, these are the only available Actions:
 Delegate work to co-worker: Delegate work to co-worker(task: str, context: str, coworker: Optional[str] = None, **kwargs) - Delegate a specific task to one of the following co-workers: [editor, newsfetcher, newsanalyzer, newslettercompiler]
The 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 to co-worker: Ask question to co-worker(question: str, context: str, coworker: Optional[str] = None, **kwargs) - Ask a specific question to one of the following co-workers: [editor, newsfetcher, newsanalyzer, newslettercompiler]
The 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.

would love to see it fixed.

felixgao avatar May 21 '24 22:05 felixgao

It fixes the issue for llama3, however, llama3:8b-instruct-q8_0 seems to have similar issue but it comes with a leading '.

Action: Ask question to co-worker
Action Input: {"question": "Can you explore the market size and growth prospects for AI-powered clinical documentation tools? What are some key players in this space, and what are their competitive strengths and weaknesses?", context: "As I was reading about the potential benefits of generative-AI technology in healthcare, I came across an article mentioning that the global clinical documentation software market is expected to grow significantly over the next few years. I'd like you to dig deeper into this topic and provide more insights on the market size, growth prospects, key players, and their competitive landscape.", coworker: 'Writer 


Error executing tool. Co-worker mentioned not found, it must to be one of the following options:
- writer

SYip avatar May 24 '24 23:05 SYip

Great catch! Should we also do the same for '?

gvieira avatar Jun 07 '24 00:06 gvieira

Great catch! Should we also do the same for '?

Oh, I didn't get the problem with ' but I think it's worth it since the change is minimal.

italovieira avatar Jun 07 '24 04:06 italovieira

Loved it! We are ready to merge this. Do you mind taking a look at the failing tasks?

gvieira avatar Jun 07 '24 13:06 gvieira

@italovieira Can you check if this PR is still relevant on newer versions?

pythonbyte avatar Aug 23 '24 14:08 pythonbyte

This PR is stale because it has been open for 45 days with no activity.

github-actions[bot] avatar Oct 08 '24 12:10 github-actions[bot]