Skip to content

Conversation

@xrmx
Copy link
Contributor

@xrmx xrmx commented Nov 7, 2025

Description

This PR filters out attributes where the value is NOT_GIVEN or not_given form the llm_request_attributes dictionary. These values cannot be set as an attribute value and should be treated as equivalent to None.

This warning message is generated in opentelemetry.attributes here.

Example WARNING log:

WARNING  opentelemetry.attributes:__init__.py:111 Invalid type NotGiven for attribute 'top_p' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types

Fixes #3921
Closes #3760

This is on top of #3760 but generalizes it and add tests for embeddings. While at it I've bumped the openai version in latest test requirement to latest available < 2 and added a README.md for documenting how to configure tox to let the OPENAI_API_KEY environment variable pass. No idea why I had to add datalib optional dependencies to the oldest requirements file.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • tox

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@xrmx xrmx requested a review from a team as a code owner November 7, 2025 10:35
@xrmx xrmx added the gen-ai Related to generative AI label Nov 7, 2025
@xrmx xrmx changed the title OpenAI not given openai-v2: handle NotGiven values in request parameters Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gen-ai Related to generative AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai-v2: code should also guard against NotGiven instances

7 participants