Skip to content

feat(pydantic_ai): Set request parameters - #8063

Open
ansh-rohilla wants to merge 1 commit into
getsentry:masterfrom
ansh-rohilla:feat/pydantic-ai-request-parameters-8015
Open

ansh-rohilla wants to merge 1 commit into
getsentry:masterfrom
ansh-rohilla:feat/pydantic-ai-request-parameters-8015

Conversation

@ansh-rohilla

Copy link
Copy Markdown

Summary

This PR implements request parameters tracking for the Pydantic AI integration according to issue #8015 (parent epic #7995).

Changes

  • Added SPANDATA.GEN_AI_REQUEST_SEED and SPANDATA.GEN_AI_REQUEST_TOP_K to settings_map in sentry_sdk/integrations/pydantic_ai/utils.py.
  • Added support for resolving fallback parameters from extra_body when parameters are passed inside extra body dictionaries.
  • Updated test_model_settings in tests/integrations/pydantic_ai/test_pydantic_ai.py to assert temperature, max_tokens, top_p, frequency_penalty, presence_penalty, seed, and top_k.
  • Added test_model_settings_zero_values to verify falsy zero values are recorded across streaming and static trace modes.
  • Added test_model_settings_fallback_extra_body and test_model_settings_omitted.

Fixes #8015

Add gen_ai.request.seed and gen_ai.request.top_k to pydantic_ai
model settings recording, with fallback support for extra_body.
Update test_model_settings to verify all standard parameters, and
add test cases for zero values, extra_body fallback, and omitted
settings across streaming and static trace modes.

Fixes getsentry#8015
@ansh-rohilla
ansh-rohilla requested a review from a team as a code owner October 19, 2026 12:03

This branch has not been deployed

No deployments
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.

pydantic-ai: Set request parameters

1 participant