Skip to content

fix(pydantic_ai): support pydantic-ai 2.0#538

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
pydantic-2.0-support
Open

fix(pydantic_ai): support pydantic-ai 2.0#538
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
pydantic-2.0-support

Conversation

@AbhiPrasad

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) commented Jun 29, 2026

Copy link
Copy Markdown
Member

resolves #536

AI Summary:

This makes Braintrust tracing work with pydantic-ai 2.0. Streamed agent events are traced again instead of failing because pydantic-ai changed that API.

What users will see in Braintrust: stream-event spans continue to appear, completed direct streaming spans include the final model response, and errors during stream-event consumption are recorded on the span.

Traces also include additional pydantic-ai 2.0 response details when pydantic-ai returns them, such as finish reason, provider URL/name, run id, and conversation id. This also removes an internal deprecation warning that could appear during normal setup_pydantic_ai() tracing.

This makes Braintrust tracing work with pydantic-ai 2.0. Streamed agent events are traced again instead of failing because pydantic-ai changed that API.

What users will see in Braintrust: stream-event spans continue to appear, completed direct streaming spans include the final model response, and errors during stream-event consumption are recorded on the span.

Traces also include additional pydantic-ai 2.0 response details when pydantic-ai returns them, such as finish reason, provider URL/name, run id, and conversation id. This also removes an internal deprecation warning that could appear during normal setup_pydantic_ai() tracing.
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.

Support pydantic-ai 2.0 in Python SDK integration

1 participant