Skip to content

opentelemetry-util-genai: Align message-part class names with semconv (*Part suffix) (Util changes) - #450

Open
rads-1996 wants to merge 4 commits into
open-telemetry:mainfrom
rads-1996:align-models-with-semconv-util
Open

opentelemetry-util-genai: Align message-part class names with semconv (*Part suffix) (Util changes)#450
rads-1996 wants to merge 4 commits into
open-telemetry:mainfrom
rads-1996:align-models-with-semconv-util

Conversation

@rads-1996

@rads-1996 rads-1996 commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Complies with the semantic conventions for non-normative models. (util changes)

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. List any relevant details for your test
configuration.

  • All test suites have been run

Checklist

See CONTRIBUTING.md
for the style guide, changelog guidance, and more.

  • Followed the style guidelines of this project
  • Changelog updated if the change requires an entry
  • Unit tests added
  • Documentation updated

@rads-1996
rads-1996 force-pushed the align-models-with-semconv-util branch from b38650a to c6c78f1 Compare August 21, 2026 18:15
@rads-1996 rads-1996 changed the title opentelemetry-genai-util: Align message-part class names with semconv (*Part suffix) (Util changes) opentelemetry-util-genai: Align message-part class names with semconv (*Part suffix) (Util changes) Aug 21, 2026
@rads-1996
rads-1996 marked this pull request as ready for review August 21, 2026 18:44
@rads-1996
rads-1996 requested a review from a team as a code owner August 21, 2026 18:44
Copilot AI lite review requested due to automatic review settings August 21, 2026 18:44
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 21, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-08-21 23:15 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates opentelemetry-util-genai message-part model naming to align with the GenAI semconv non-normative Python models (using *Part suffixes), while keeping backwards-compatible access to the pre-*Part names.

Changes:

  • Renamed message-part dataclasses in types.py to *Part names and updated the MessagePart union accordingly.
  • Updated util tests and upload-related logic to use the new *Part names; added tests asserting the legacy names still resolve.
  • Updated util README wording and added Towncrier fragments describing the change + deprecations.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py Renames message-part classes to *Part, updates MessagePart, and adds legacy-name aliases.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py Updates hashability check to use TextPart.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_tool_invocation.py Updates docstring to refer to ToolCallRequestPart for message parts.
util/opentelemetry-util-genai/tests/test_utils.py Switches helpers to TextPart and adds tests for legacy alias behavior.
util/opentelemetry-util-genai/tests/test_toolcall.py Updates tests to *Part tool-call types and adds alias-compat tests.
util/opentelemetry-util-genai/tests/test_upload.py Updates upload hook tests to use TextPart and *Part tool-call message parts.
util/opentelemetry-util-genai/tests/test_workflow_invocation.py Updates workflow invocation tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_workflow.py Updates handler workflow tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_fetch_response.py Updates handler fetch-response test data to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_completion_hook.py Updates completion-hook tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_agent.py Updates agent handler tests to use TextPart.
util/opentelemetry-util-genai/README.rst Updates README terminology to reference *Part message types.
util/opentelemetry-util-genai/.changelog/450.changed Towncrier fragment for the naming alignment.
util/opentelemetry-util-genai/.changelog/450.deprecated Towncrier fragment documenting the deprecation of legacy names.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py Outdated
@rads-1996
rads-1996 marked this pull request as draft August 21, 2026 18:51
@rads-1996
rads-1996 marked this pull request as ready for review August 21, 2026 20:59
Comment on lines +277 to +284
@dataclass()
class Uri(UriPart):
"""Represents an external referenced file sent to the model by URI

.. deprecated:: 1.2b0
Use ``UriPart`` instead.
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these deprecated notices and extra classes looks like a lot of tech debt to take on for an experimental package.

Is there a strong reason to align with the non-normative conventions? We could even update the non-normative conventions to match the names in this util. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aabmass The initial discussion for this change started in another PR -

image

Following Liudmila's remark, I went and checked that for some data classes we were following the non-normative semantic conventions and for some we weren't.

Even if we move with the suggestion of modifying the semantic conventions, we will still have to provide backward compatibility for the classes which already included the *Part suffix such as GenericPart, CompactionPart. Unless we don't mind some classes having the *Part suffix and others not.

@rads-1996
rads-1996 force-pushed the align-models-with-semconv-util branch from 6e0b3e6 to 32f99cf Compare August 21, 2026 22:43
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.

3 participants