We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14f9914 commit caa058aCopy full SHA for caa058a
src/agentlab/llm/response_api.py
@@ -187,6 +187,12 @@ def prepare_message(self) -> List[Message]:
187
"content": output["content"],
188
}
189
]
190
+ if self.role == "assistant":
191
+ # Strip whitespace from assistant text responses. See anthropic error code 400.
192
+ for c in output["content"]:
193
+ if 'text' in c:
194
+ c["text"] = c["text"].strip()
195
+
196
return [output]
197
198
def transform_content(self, content: ContentItem) -> ContentItem:
0 commit comments