pub struct RunSpan {}Expand description
A run’s span recorder. Begin it once (mints the invoke_agent span id under
the run trace), record a chat/execute_tool child as each completes, then
finish to flush the whole trace. Every method is a no-op without the
otel feature (or without OTEL_EXPORTER_OTLP_ENDPOINT), so the loop wires
it unconditionally with no cfg at the call sites.
Implementations§
Source§impl RunSpan
impl RunSpan
Sourcepub fn record_chat(
&mut self,
model: &str,
input_tokens: u64,
output_tokens: u64,
ok: bool,
start_unix_nanos: u128,
)
pub fn record_chat( &mut self, model: &str, input_tokens: u64, output_tokens: u64, ok: bool, start_unix_nanos: u128, )
Record a chat child span for one model call (parent = the run span).
Sourcepub fn record_tool(&mut self, tool_name: &str, ok: bool, start_unix_nanos: u128)
pub fn record_tool(&mut self, tool_name: &str, ok: bool, start_unix_nanos: u128)
Record an execute_tool child span for one tool call (parent = the run span).
Auto Trait Implementations§
impl Freeze for RunSpan
impl RefUnwindSafe for RunSpan
impl Send for RunSpan
impl Sync for RunSpan
impl Unpin for RunSpan
impl UnsafeUnpin for RunSpan
impl UnwindSafe for RunSpan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more