Skip to content

Align message-part class names with semconv (*Part suffix) - #365

Draft
rads-1996 wants to merge 5 commits into
open-telemetry:mainfrom
rads-1996:align-models-with-semconv
Draft

Align message-part class names with semconv (*Part suffix)#365
rads-1996 wants to merge 5 commits into
open-telemetry:mainfrom
rads-1996:align-models-with-semconv

Conversation

@rads-1996

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

Copy link
Copy Markdown
Contributor

Description

Complies with the semantic conventions for non-normative models.

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 branch from cff1a11 to 5f2e10e Compare August 7, 2026 15:57
@rads-1996
rads-1996 marked this pull request as ready for review August 7, 2026 16:22
@rads-1996
rads-1996 requested a review from a team as a code owner August 7, 2026 16:22
Copilot AI lite review requested due to automatic review settings August 7, 2026 16:22
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 7, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-07 16:36 UTC

Move out of draft to request review.

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

This PR updates the shared opentelemetry-util-genai message-part model class names to align with the GenAI semantic conventions non-normative models (adding the *Part suffix), and propagates those renames through dependent instrumentation packages and their tests.

Changes:

  • Rename util-genai message-part dataclasses (e.g., TextTextPart, ToolCallRequestToolCallRequestPart) and update MessagePart accordingly.
  • Update util-genai tests and several instrumentations (OpenAI, Anthropic, LangChain, Google GenAI, Qwen Agent, Agno) to use the new *Part names.
  • Add per-package towncrier changelog fragments documenting the rename.

Reviewed changes

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

Show a summary per file
File Description
util/opentelemetry-util-genai/tests/test_workflow_invocation.py Update workflow invocation tests to use TextPart.
util/opentelemetry-util-genai/tests/test_utils.py Update helper constructors to use TextPart.
util/opentelemetry-util-genai/tests/test_upload.py Update upload hook tests to use *Part types.
util/opentelemetry-util-genai/tests/test_toolcall.py Update toolcall tests/docstrings to *Part names.
util/opentelemetry-util-genai/tests/test_handler_workflow.py Update handler workflow tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_fetch_response.py Update fetch-response handler tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_completion_hook.py Update completion-hook tests to use TextPart.
util/opentelemetry-util-genai/tests/test_handler_agent.py Update agent handler tests to use TextPart.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/types.py Rename message-part dataclasses to *Part and update MessagePart union.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_upload/completion_hook.py Update hashability check to use TextPart.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_tool_invocation.py Update docstring reference to ToolCallRequestPart.
util/opentelemetry-util-genai/README.rst Update docs to mention *Part message types.
util/opentelemetry-util-genai/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-google-genai/tests/interactions/test_parser.py Update tests to assert *Part types.
instrumentation/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/message.py Update message conversion to construct *Part types.
instrumentation/opentelemetry-instrumentation-google-genai/src/opentelemetry/instrumentation/google_genai/interactions.py Update interactions conversion to use *Part types.
instrumentation/opentelemetry-instrumentation-google-genai/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/src/opentelemetry/instrumentation/genai/qwen_agent/utils.py Update Qwen Agent conversion helpers to *Part types.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-genai-openai/tests/test_response_extractors.py Update patching test to reference TextPart.
instrumentation/opentelemetry-instrumentation-genai-openai/src/opentelemetry/instrumentation/genai/openai/utils.py Update OpenAI message prep to emit *Part types.
instrumentation/opentelemetry-instrumentation-genai-openai/src/opentelemetry/instrumentation/genai/openai/response_extractors.py Update response extraction helpers to use TextPart / ReasoningPart.
instrumentation/opentelemetry-instrumentation-genai-openai/src/opentelemetry/instrumentation/genai/openai/chat_wrappers.py Update streaming buffers to emit TextPart / ToolCallRequestPart.
instrumentation/opentelemetry-instrumentation-genai-openai/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-genai-langchain/tests/test_callback_handler.py Update LangChain tests to use TextPart / ToolCallRequestPart.
instrumentation/opentelemetry-instrumentation-genai-langchain/src/opentelemetry/instrumentation/genai/langchain/utils.py Update LangChain conversion utilities to *Part types and docstrings.
instrumentation/opentelemetry-instrumentation-genai-langchain/src/opentelemetry/instrumentation/genai/langchain/callback_handler.py Update callback handler to emit TextPart / ToolCallRequestPart.
instrumentation/opentelemetry-instrumentation-genai-langchain/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-genai-anthropic/src/opentelemetry/instrumentation/genai/anthropic/utils.py Update Anthropic conversion utilities to emit *Part types.
instrumentation/opentelemetry-instrumentation-genai-anthropic/.changelog/365.changed Add changelog fragment for the rename.
instrumentation/opentelemetry-instrumentation-genai-agno/tests/requirements.oldest.txt Add util-genai editable install note for oldest tests.
instrumentation/opentelemetry-instrumentation-genai-agno/src/opentelemetry/instrumentation/genai/agno/patch.py Update Agno patching to use TextPart.
instrumentation/opentelemetry-instrumentation-genai-agno/pyproject.toml Bump util-genai dependency lower bound to 1.1b0.dev.
instrumentation/opentelemetry-instrumentation-genai-agno/.changelog/365.changed Add changelog fragment for the rename.
.github/skills/write-conformance-tests/SKILL.md Update documentation table to reference *Part types.
.github/skills/migrate-from-openinference/SKILL.md Update migration guidance to reference *Part types.

Comment on lines 223 to +227
ToolDefinition = Union[FunctionToolDefinition, GenericToolDefinition]

MessagePart = Union[
Text,
ToolCallRequest,
ToolCallResponse,
ServerToolCall,
ServerToolCallResponse,
Blob,
File,
Uri,
Reasoning,
TextPart,
ToolCallRequestPart,
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.

2 participants