phidatahq / phidata

Build AI Agents with memory, knowledge, tools and reasoning. Chat with them using a beautiful Agent UI.
https://docs.phidata.com
Mozilla Public License 2.0
14.07k stars 1.97k forks source link

ollama tools usage always returns empty responses #1203

Open ofri opened 3 weeks ago

ofri commented 3 weeks ago

I believe this is because the condition in https://github.com/phidatahq/phidata/blame/c55547110638dd85158528c43d74006a77390a44/phi/llm/ollama/chat.py#L150 (if tool_calls_result.tool_calls is not None) can never evaluate to True. This is because we are inside an if block (L146) with an opposite condition if tool_calls_result.tool_calls is None and <some other condition>.

I think the code block in L150 should be de-indented 1 level, but will try to test and open a PR if that solves the issue, but would appreciate a sanity check from a developer more familiar with the project before I go at it.

ofri commented 3 weeks ago

Probably related to https://github.com/phidatahq/phidata/issues/1178