Skip to content

[opentelemetry-util-genai] Decouple stream wrappers from GenAIInvocation with typing protocols - #745

Merged
lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:refactor/stream-wrapper-typing-protocols
Sep 21, 2026
Merged

lmolkova merged 3 commits into
open-telemetry:mainfrom
lmolkova:refactor/stream-wrapper-typing-protocols

Conversation

@lmolkova

@lmolkova lmolkova commented Sep 19, 2026

Copy link
Copy Markdown
Member

What does this change do?

Replaces GenAIInvocation typing dependencies in stream.py with _StreamTimingInvocation and _StreamingInvocation protocols.

Why?

Decouples public stream wrappers from internal _invocation.py implementation details and helps prepare for codegen (#702).

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 19, 2026

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-09-21 04:45 UTC

Status above doesn't look right?
  • 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.

Copilot review overview

🟡 Changes recommended

Protocol-only invocation paths lack sync and async regression tests.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Decouples stream wrappers from GenAIInvocation using structural protocols while preserving streaming timing and markers.

Changes:

  • Adds timing and streaming invocation protocols.
  • Updates sync and async wrappers to use protocol-based typing.
  • Conditionally sets the stream marker for compatible invocations.
File Description
util/​opentelemetry-util-genai/​src/​opentelemetry/​util/​genai/​stream.py Introduces protocols and updates wrapper invocation handling.

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

@lmolkova lmolkova added the Skip Changelog PR does not require a changelog entry label Sep 19, 2026
@lmolkova
lmolkova added this pull request to the merge queue Sep 21, 2026
Merged via the queue into open-telemetry:main with commit ede28ba Sep 21, 2026
75 checks passed
@lmolkova
lmolkova deleted the refactor/stream-wrapper-typing-protocols branch September 21, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PR does not require a changelog entry

Development

Successfully merging this pull request may close these issues.

3 participants