record_gen_ai_request_attrs

Function record_gen_ai_request_attrs 

Source
pub fn record_gen_ai_request_attrs(
    span: &Span,
    system: &str,
    request_model: &str,
    max_tokens: Option<u64>,
    temperature: Option<f64>,
    top_p: Option<f64>,
)
Expand description

Record the request-side OTel GenAI semantic-convention attributes (AI-07) onto an AI span. The span MUST have been created with every gen_ai.* field declared as tracing::field::Empty (see gen_ai_span_fields); Span::record only fills fields the span’s metadata already declared. Request-side fields are always available once the canonical crate::ai::types::ChatRequest is parsed; the system is the serving provider’s kind (crate::config::ai::AiProviderKind::gen_ai_system).