When LLMs like Anthropic return both text content AND tool calls in
the same response, the text response was being returned instead of
the tool calls when available_functions=None. This caused the executor
to treat the text as a final answer, discarding the tool calls.
The fix reorders the priority checks in all 4 response handlers
(_handle_non_streaming_response, _ahandle_non_streaming_response,
_handle_streaming_response, _ahandle_streaming_response) so that
tool calls are returned before falling back to text content when
available_functions is None.
Fixes#4788
Co-Authored-By: João <joao@crewai.com>