-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ollama giving issues with multiple Tools. #1612
Comments
Hello @alaap001 ! Thank you for the kind words! Ollama recently made an update to tool call streaming. Can you please verify that your Ollama app, Ollama python sdk and phidata are all updated to the latest version? |
It worked by updating but now getting this on a simple query like "What are all the tables I have?"
Sometimes I randomly get:
OR with Knowledge Assistant
|
@alaap001 If it happens randomly, the model is most likely hallucinating. I think you are using qwen2.5 7b model which is a small model and will not give you 100% accuracy |
Let me try with Qwen2.5 32B, I hope that is good enough, Will report back if I face this. |
@alaap001 for a high-quality DB agent that can generate SQL query you will have to use a self evaluation loop and do it via workflow. Here is an example that I made yesterday as a reference for you https://github.com/phidatahq/phidata/pull/1638/files There will be an agent that generates the SQL query, another that checks for the validity of the query, and another one to run the query.. |
@manthanguptaa Hey, Thanks for the help. I did made some changes and converted the application to workflow, however, I still see a major difference when using tools with Ollama and OpenAI. For reference, I am using Ollama When using OpenAI gpt4o mini I get proper tool calls which can later help in generation of correct query
When using Qwen 72B instruct I don't see any calls to tools, which naturally leads to incorrect query generation.
As you can see no call to tools happened, while OpenAI used the relevant tool calls to understand schema and generate correct query. My code example is as shown:
Am I doing something wrong? or is it that Ollama isn't good enough for tool calls? |
Also @manthanguptaa there wasn't a proper doc on workflow so I only used available cookbooks to understand and build something, please let me know if you find anything in the code that isn't a good workflow practice or something that can be improved. |
Hey,
Thanks for the amazing work.
I am facing issue with Ollama in multiple tools, When using OpenAIChat everything works, but when I use Ollama with Agents I get errors as shown below.
I tried Using Agent with Ollama model with 2 different tools and both gave issues.
Reproducable Code:
No Errors reported but in UI I don't get any output:
<tool_call> {"name": "duckduckgo_news", "arguments": {"query": "today", "max_results": 5}} </tool_call>
This is a bigger problem
Reproducable Code:
Error:
Is it a bug that needs to be fixed causing this? or am I doing something wrong?
Please review the code also and suggest me if I used it wrong, I just got started with phiData 2 days back.
Any help would be appreciated, thanks.
The text was updated successfully, but these errors were encountered: