Files
crewAI/lib/crewai/tests
Devin AI 1c082b909f fix: convert tool_calls to string when no available_functions provided
Fixes #4036 - Models with native function calling (like Ollama) fail when
the model returns tool_calls but no available_functions are provided.

Previously, when a model returned tool_calls without text content and no
available_functions were provided, the raw tool_calls list was returned.
This list would then cause a "'list' object has no attribute 'rstrip'"
error when passed to format_message_for_llm().

Now, tool_calls are converted to a human-readable string representation
containing the tool name and arguments. This allows the agent to see what
tool the model wanted to call and handle it through text-based parsing.

Changes:
- Modified _handle_non_streaming_response to convert tool_calls to string
- Modified _ahandle_non_streaming_response with the same fix
- Added warning log when this conversion occurs
- Added tests covering the fix for both sync and async paths

Co-Authored-By: João <joao@crewai.com>
2025-12-05 20:55:10 +00:00
..
2025-12-05 13:23:26 -05:00
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-12-04 16:53:19 -05:00
2025-12-04 12:54:49 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-04 13:34:29 -08:00
2025-12-05 13:23:26 -05:00
2025-12-02 16:39:58 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-12-04 17:08:08 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00