mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-16 11:38:31 +00:00
This fixes issue #4238 where Gemini models fail with UNEXPECTED_TOOL_CALL errors because tools were not being passed to the LLM call. Changes: - Add _extract_tools_from_context() helper function to extract tools from executor context (CrewAgentExecutor or LiteAgent) and convert them to dict format compatible with LLM providers - Update get_llm_response() to extract and pass tools to llm.call() - Update aget_llm_response() to extract and pass tools to llm.acall() - Add comprehensive tests for the new functionality Co-Authored-By: João <joao@crewai.com>