Skip to content

feat(weave): add provider name to turns - #7654

Closed
rgao-coreweave wants to merge 1 commit into
masterfrom
rgao/python-turn-provider-name
Closed

feat(weave): add provider name to turns#7654
rgao-coreweave wants to merge 1 commit into
masterfrom
rgao/python-turn-provider-name

Conversation

@rgao-coreweave

Copy link
Copy Markdown
Contributor

Summary

  • Add optional provider_name to the Python Turn model.
  • Thread it through Conversation.start_turn(), module-level start_turn(), Turn.record(), and log_turn().
  • Emit it as gen_ai.provider.name on root invoke_agent spans in both streaming and batch flows.
  • Add focused coverage for each public entry point.

Testing

  • uv run --no-sync --group test python -m pytest tests/conversation/test_conversation_otel.py -q (179 passed)
  • uvx ruff check weave/conversation/conversation.py tests/conversation/test_conversation_otel.py
  • uvx ruff format --check weave/conversation/conversation.py tests/conversation/test_conversation_otel.py

Breaking changes

None. The new parameter and field are optional and default to an empty string.

Related

Prerequisite for #7642, which uses the typed parameter in the Claude Agent SDK integration.

agent_name=self.agent_name,
conversation_id=conversation_id,
conversation_name=conversation_name,
provider_name=self.provider_name,

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.

Seems the current standard has removed this label? open-telemetry/semantic-conventions-genai#289

Curious about what should gen_ai.provider.name represent on this internal invoke_agent span when one turn can use multiple model providers?

could setting it here, for example, conflict with the current OTel convention, which removed this attribute from internal agent spans?

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.

oh true, good findings!

From PR's design, the turn's provider name should propagate down to the children spans, and the children spans can override the provider name.

From current state, it wouldn't make sense to show this info at the turn level since one turn can clearly use multiple model providers.

I am okay dropping this PR as well!

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants