Skip to content

feat(litellm): Set request parameters - #8062

Open
ansh-rohilla wants to merge 1 commit into
getsentry:masterfrom
ansh-rohilla:feat/litellm-request-parameters-7994
Open

ansh-rohilla wants to merge 1 commit into
getsentry:masterfrom
ansh-rohilla:feat/litellm-request-parameters-7994

Conversation

@ansh-rohilla

Copy link
Copy Markdown

Summary

This PR implements request parameters tracking for the LiteLLM integration according to issue #7994 (parent epic #7995).

Changes

  • Added SPANDATA.GEN_AI_REQUEST_SEED and SPANDATA.GEN_AI_REQUEST_TOP_K to the recorded parameters in sentry_sdk/integrations/litellm.py.
  • Added support for falling back to optional_params and extra_body dictionaries when parameters are routed or wrapped by LiteLLM for specific model providers.
  • Updated test_additional_parameters and test_async_additional_parameters in tests/integrations/litellm/test_litellm.py to assert seed and top_k attributes across static and streaming trace modes.
  • Added test_additional_parameters_zero_values to verify falsy 0 values are preserved.
  • Added test_input_callback_fallback_extra_body and test_input_callback_omitted_parameters unit tests.

Fixes #7994

Add gen_ai.request.seed and gen_ai.request.top_k to litellm request
parameters recording, with fallback support for optional_params and
extra_body dictionaries. Add tests for provided values, zero values,
fallback resolution, and omitted parameters across streaming and static
trace modes.

Fixes getsentry#7994
@ansh-rohilla
ansh-rohilla requested a review from a team as a code owner October 19, 2026 11:51

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.

litellm: Set request parameters

1 participant