Skip to main content

SpanCombinator

Trait SpanCombinator 

Source
pub trait SpanCombinator {
    // Required methods
    fn record_token_usage(&self, usage: &Usage);
    fn record_response(
        &self,
        response_id: Option<&str>,
        model: Option<&str>,
        usage: &Usage,
    );
}
Expand description

Records GenAI usage and response metadata on tracing spans.

Required Methods§

Source

fn record_token_usage(&self, usage: &Usage)

Record Rig-normalized token usage fields on the span.

Source

fn record_response( &self, response_id: Option<&str>, model: Option<&str>, usage: &Usage, )

Record a response’s ID, model, and token usage on the span.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SpanCombinator for Span

Source§

fn record_token_usage(&self, usage: &Usage)

Source§

fn record_response( &self, response_id: Option<&str>, model: Option<&str>, usage: &Usage, )

Implementors§