Skip to main content

chat_span

Function chat_span 

Source
pub fn chat_span(system: &str, model: &str, latest_semconv: bool) -> Span
Expand description

Build a chat {model} span for a chat-completion request.

Only the fields that are cheap/always-known at call time are set here (gen_ai.system / gen_ai.provider.name, gen_ai.request.model); the rest of the request/response/error attribute set is filled in afterward via record_request, record_response, and record_error — mirrors _get_span_attributes (observability.py:1345-1404).