mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-02 05:38:12 +00:00
MagicMock objects (and other non-Anthropic responses) can return non-string values for getattr(response, 'stop_reason', None). Add a typed extraction helper that returns None unless the value is actually a string, preventing Pydantic validation errors in LLMCallCompletedEvent. Co-Authored-By: João <joao@crewai.com>