mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 13:48:09 +00:00
When both native function calling (tools) and output_pydantic (response_model) are enabled, InternalInstructor was intercepting the LLM call and creating its own completion without passing tools. This caused agent tools to be silently discarded. The fix checks whether tools are present in params before routing to InternalInstructor. When tools exist, the normal litellm.completion path is used so the LLM can see and call the agent's tools. InternalInstructor is still used when no tools are present (backward compatible). Applied to all three response handlers: - _handle_non_streaming_response - _ahandle_non_streaming_response - _handle_streaming_response Co-Authored-By: João <joao@crewai.com>