feat(weave): add provider name to turns - #7654
Conversation
| agent_name=self.agent_name, | ||
| conversation_id=conversation_id, | ||
| conversation_name=conversation_name, | ||
| provider_name=self.provider_name, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
Summary
provider_nameto the PythonTurnmodel.Conversation.start_turn(), module-levelstart_turn(),Turn.record(), andlog_turn().gen_ai.provider.nameon rootinvoke_agentspans in both streaming and batch flows.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.pyuvx ruff format --check weave/conversation/conversation.py tests/conversation/test_conversation_otel.pyBreaking 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.