Skip to content

Commit 0f1405c

Browse files
committed
fix(anthropic) compatibility fix for v0.16
1 parent 5087bc4 commit 0f1405c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sentry_sdk/integrations/anthropic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,12 @@ def _sentry_patched_create_common(f, *args, **kwargs):
212212
input_tokens,
213213
output_tokens,
214214
content_blocks=[
215-
content_block.to_dict() for content_block in result.content
215+
(
216+
content_block.to_dict()
217+
if hasattr(content_block, "to_dict")
218+
else content_block.model_dump()
219+
)
220+
for content_block in result.content
216221
],
217222
finish_span=True,
218223
)

0 commit comments

Comments
 (0)