You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kwargs["metadata"] = {} # Used as shared reference between hooks
108
+
104
109
returnoriginal_init(self, *args, **kwargs)
105
110
106
111
Agent.__init__=patched_init
@@ -118,13 +123,12 @@ class PydanticAIIntegration(Integration):
118
123
Hooks using the decorators provided by `pydantic_ai.capabilities` create and manage spans for model calls when these hooks are available (newer library versions).
119
124
The span is created in `on_request` and stored in the metadata of the `RunContext` object shared with `on_response` and `on_error`.
120
125
121
-
The metadata dictionary on the RunContext instance is initialized with `{"_sentry_span": None}` in the `_create_run_wrapper()` and `_create_streaming_wrapper()` wrappers that
122
-
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.
126
+
The metadata on the RunContext instance is initialized with an empty dictionary in `Agent.__init__()`. The dictionary is required for the metadata object
0 commit comments