Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions livekit-agents/livekit/agents/telemetry/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ def __call__(self) -> dict[str, str]:
def _chat_ctx_to_otel_events(chat_ctx: ChatContext) -> list[tuple[str, Attributes]]:
role_to_event = {
"system": trace_types.EVENT_GEN_AI_SYSTEM_MESSAGE,
# OpenAI's `developer` role is the successor to `system` on the
# Chat Completions API and carries equivalent instructional content,
# so surface it as the system-message span event rather than dropping
# it on the floor.
"developer": trace_types.EVENT_GEN_AI_SYSTEM_MESSAGE,
"user": trace_types.EVENT_GEN_AI_USER_MESSAGE,
"assistant": trace_types.EVENT_GEN_AI_ASSISTANT_MESSAGE,
}
Expand Down
Loading