Skip to content

ref(pydantic_ai): migrate wrapper to integration patchers#182

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit intomainfrom
abhi-refactor-migrate-pydantic-ai-integration
Mar 31, 2026
Merged

ref(pydantic_ai): migrate wrapper to integration patchers#182
Abhijeet Prasad (AbhiPrasad) merged 1 commit intomainfrom
abhi-refactor-migrate-pydantic-ai-integration

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

ref #116

Convert the Pydantic AI instrumentation from the legacy wrappers pattern to the new integrations API introduced in #118.

Move the Pydantic AI wrapper implementation into the integrations package and keep the legacy wrapper module as a compatibility re-export. This aligns the provider with the newer integration architecture and consolidates its tests, auto-instrument wiring, and public exports in one place.

Add generic class-scan support in the shared integration base so runtime-loaded subclasses can be rescanned and patched without leaking patch-marker details into tracing code. Use that helper for Pydantic AI model-class wrapping and move wrap_model_classes into patchers so patcher-specific behavior stays in the patching layer.

Fixes #168
supercedes #169

@starfolkai

This comment was marked as outdated.

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) force-pushed the abhi-refactor-migrate-pydantic-ai-integration branch from 220e5b0 to 9ca63e8 Compare March 31, 2026 15:41
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) marked this pull request as draft March 31, 2026 16:00
Move the Pydantic AI wrapper implementation into the integrations package and keep the
legacy wrapper module as a compatibility re-export. This aligns the provider
with the newer integration architecture and consolidates its tests,
auto-instrument wiring, and public exports in one place.

Add generic class-scan support in the shared integration base so runtime-loaded
subclasses can be rescanned and patched without leaking patch-marker details
into tracing code. Use that helper for Pydantic AI model-class wrapping and
move wrap_model_classes into patchers so patcher-specific behavior stays in the
patching layer.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) force-pushed the abhi-refactor-migrate-pydantic-ai-integration branch from 9ca63e8 to 3f6d01c Compare March 31, 2026 16:28
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) marked this pull request as ready for review March 31, 2026 17:30
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.

stamp

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) merged commit 4e5c83f into main Mar 31, 2026
36 checks passed
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) deleted the abhi-refactor-migrate-pydantic-ai-integration branch March 31, 2026 20:07
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.

google_genai and pydantic init_logger unconditionally called during auto_instrument

2 participants