diff --git a/letta/interfaces/anthropic_streaming_interface.py b/letta/interfaces/anthropic_streaming_interface.py index fc0741b9..84178932 100644 --- a/letta/interfaces/anthropic_streaming_interface.py +++ b/letta/interfaces/anthropic_streaming_interface.py @@ -320,4 +320,10 @@ class AnthropicStreamingInterface: if current_group: merged.append(_process_group(current_group, current_group_type)) + # Strip out XML from any text content fields + for content in merged: + if isinstance(content, TextContent) and content.text.endswith(""): + cutoff = len(content.text) - len("") + content.text = content.text[:cutoff] + return merged