We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b00ca97 commit 9ae1c31Copy full SHA for 9ae1c31
src/codegate/muxing/adapter.py
@@ -101,7 +101,10 @@ def _format_antropic(self, chunk: str) -> str:
101
"""
102
cleaned_chunk = chunk.split("data:")[1].strip()
103
try:
104
- chunk_dict = json.loads(cleaned_chunk)
+ # Use `strict=False` to allow the JSON payload to contain
105
+ # newlines, tabs and other valid characters that might
106
+ # come from Anthropic returning code.
107
+ chunk_dict = json.loads(cleaned_chunk, strict=False)
108
except Exception as e:
109
logger.warning(f"Error parsing Anthropic chunk: {chunk}. Error: {e}")
110
return cleaned_chunk.strip()
0 commit comments