Skip to content

Implement unified part-wise metadata - #85

Merged
anbuzin merged 8 commits into
mainfrom
part-wise-metadata
May 10, 2026
Merged

Implement unified part-wise metadata#85
anbuzin merged 8 commits into
mainfrom
part-wise-metadata

Conversation

@anbuzin

@anbuzin anbuzin commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Put provider_metadata on Parts and Messages. From now on this is how thinking signatures and other similar things are going to roundtrip. There's much more metadata that providers attach per-part, which I'll add in a separate PR.

@vercel

vercel Bot commented May 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
py-ai Ready Ready Preview, Comment May 10, 2026 3:16pm

Request Review

@anbuzin
anbuzin requested a review from msullivan May 9, 2026 00:03
)


class AnthropicProviderMetadata(types.metadata.ProviderMetadata):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth putting all this in a class, instead of handling a json blob or something? How does it get provided to us by the anthropic SDK?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an excellent question, actually

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Anthropic SDK does provide types, and then we map from those to ours. Whether or not it's worth it, I'm not sure: on one hand, having a reasoning.signarture is nice, on the other, you as a user will probably never interact with it.

@anbuzin
anbuzin force-pushed the part-wise-metadata branch from bd09759 to 95c72df Compare May 10, 2026 15:16
@anbuzin
anbuzin merged commit 1eefc77 into main May 10, 2026
6 checks passed
@anbuzin
anbuzin deleted the part-wise-metadata branch May 10, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants