mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-12 05:52:39 +00:00
Fixes #4413. Anthropic API rejects requests where the final assistant message ends with trailing whitespace (400 invalid_request_error). This strips trailing whitespace from the last assistant message content in _format_messages_for_anthropic, handling both string and list content. Co-Authored-By: João <joao@crewai.com>