Skip to content

Commit 80c2ee6

Browse files
document 2
1 parent 87bfb08 commit 80c2ee6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sentry_sdk/integrations/pydantic_ai/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ class PydanticAIIntegration(Integration):
113113
3. In a loop, the agent repeatedly calls the model, maintaining a conversation history that includes previous messages and tool results, which is passed to each call.
114114
115115
Internally, Pydantic AI maintains an execution graph in which ModelRequestNode are responsible for model calls, including retries.
116-
Hooks created with the decorators provided by `pydantic_ai.capabilities` are used to create spans for model calls when these hooks are available (newer library versions).
117-
The span is created in `on_request` and stored in the metadata of the shared `RunContext` object that is passed to `on_response` and `on_error`.
116+
Hooks using the decorators provided by `pydantic_ai.capabilities` create and manage spans for model calls when these hooks are available (newer library versions).
117+
The span is created in `on_request` and stored in the metadata of the `RunContext` object shared with `on_response` and `on_error`.
118118
119119
The metadata dictionary on the RunContext instance is initialized with `{"_sentry_span": None}` in the `_create_run_wrapper()` and `_create_streaming_wrapper()` wrappers that
120120
instrument `Agent.run()` and `Agent.run_stream()`, respectively. A non-empty dictionary is required for the metadata object to be a shared reference between hooks.

0 commit comments

Comments
 (0)