mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 09:08:31 +00:00
When Gemini returns a function call without text content, the response was being returned as empty/None, causing 'Invalid response from LLM call - None or empty' errors. This fix: 1. Adds _format_function_call_as_action() to format function calls as 'Action: <name>\nAction Input: <args>' text that CrewAI's parser can understand 2. Adds _extract_text_from_parts() to properly extract text from response parts instead of relying on response.text 3. Updates _process_response_with_tools() to use the fallback format when no text content is available 4. Updates _finalize_streaming_response() with the same fallback logic Fixes #4093 Co-Authored-By: João <joao@crewai.com>