Commit Graph

2 Commits

Author SHA1 Message Date
Devin AI
082cbd2c1c Fix lint issues and improve patch implementation
Co-Authored-By: Joe Moura <joao@crewai.com>
2025-05-03 02:25:10 +00:00
Devin AI
3361fab293 Fix IndexError in litellm's ollama_pt function when using Ollama/Qwen models with tools
This patch addresses issue #2744 by adding bounds checking before accessing
messages[msg_i].get('tool_calls') in the ollama_pt function. The issue occurs
when an assistant message is the last message in the list, causing msg_i to
go out of bounds.

The fix is implemented as a monkey patch in CrewAI to avoid waiting for
an upstream fix in litellm.

Co-Authored-By: Joe Moura <joao@crewai.com>
2025-05-03 02:07:03 +00:00