Skip to content

Commit 38ecbd5

Browse files
chore(pydantic-ai): Remove include_prompts parameter
1 parent 0dbe856 commit 38ecbd5

3 files changed

Lines changed: 22 additions & 232 deletions

File tree

‎sentry_sdk/integrations/pydantic_ai/__init__.py‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,14 @@ class PydanticAIIntegration(Integration):
172172
identifier = "pydantic_ai"
173173
origin = f"auto.ai.{identifier}"
174174

175-
def __init__(
176-
self, include_prompts: bool = True, handled_tool_call_exceptions: bool = True
177-
) -> None:
175+
def __init__(self, handled_tool_call_exceptions: bool = True) -> None:
178176
"""
179177
Initialize the Pydantic AI integration.
180178
181179
Args:
182-
include_prompts: Whether to include prompts and messages in span data.
183-
Requires send_default_pii=True. Defaults to True.
184180
handled_tool_exceptions: Capture tool call exceptions that Pydantic AI
185181
internally prevents from bubbling up.
186182
"""
187-
self.include_prompts = include_prompts
188183
self.handled_tool_call_exceptions = handled_tool_call_exceptions
189184

190185
@staticmethod

‎sentry_sdk/integrations/pydantic_ai/utils.py‎

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,20 @@
1919
from pydantic_ai.settings import ModelSettings
2020

2121

22-
def _should_send_prompts_legacy() -> bool:
23-
"""
24-
Check if prompts should be sent to Sentry based on the deprecated
25-
``send_default_pii`` option and the ``include_prompts`` integration setting.
26-
27-
TODO: Remove this once `send_default_pii` is deprecated.
28-
"""
29-
if not should_send_default_pii():
30-
return False
31-
32-
from . import PydanticAIIntegration
33-
34-
# Get the integration instance from the client
35-
integration = sentry_sdk.get_client().get_integration(PydanticAIIntegration)
36-
37-
if integration is None:
38-
return False
39-
40-
return getattr(integration, "include_prompts", False)
41-
42-
4322
def _should_send_inputs() -> bool:
4423
client = sentry_sdk.get_client()
4524
if has_data_collection_enabled(client.options):
4625
return bool(client.options["data_collection"]["gen_ai"]["inputs"])
4726

48-
return _should_send_prompts_legacy()
27+
return should_send_default_pii()
4928

5029

5130
def _should_send_outputs() -> bool:
5231
client = sentry_sdk.get_client()
5332
if has_data_collection_enabled(client.options):
5433
return bool(client.options["data_collection"]["gen_ai"]["outputs"])
5534

56-
return _should_send_prompts_legacy()
35+
return should_send_default_pii()
5736

5837

5938
def _set_agent_data(span: "Span", agent: "Optional[Agent]") -> None:

0 commit comments

Comments
 (0)