fix(pydantic-ai): Use first-class hooks when available (#5947) · gitcommit90/sentry-python@59e97e7 · GitHub
Skip to content

Commit 59e97e7

Browse files
fix(pydantic-ai): Use first-class hooks when available (getsentry#5947)
Register `pydantic_ai.capabilities` hooks when available in newer versions to capture all system instructions on spans. With the commit below, per-run system instructions are set inside `ModelRequestNode._prepare_request`, which runs at the start of `run()` and `stream()`. They are no longer available before these functions execute. pydantic/pydantic-ai@f527143
1 parent 1f6816e commit 59e97e7

3 files changed

Lines changed: 339 additions & 109 deletions

File tree

sentry_sdk/integrations/pydantic_ai/__init__.py

Lines changed: 127 additions & 3 deletions

sentry_sdk/integrations/pydantic_ai/patches/agent_run.py

Lines changed: 16 additions & 0 deletions

0 commit comments

Comments
 (0)