pub struct SpanBuilder<'a> { /* private fields */ }Expand description
Builder for a canonical GenAI span.
A completion operation reuses the current span when it declares
COMPLETION_PARENT_MARKER_FIELD and every field in
COMPLETION_PARENT_REQUIRED_FIELDS, and otherwise opens a
rig::completions child of the current span. Every other operation opens a
fresh rig::modalities span.
Implementations§
Source§impl<'a> SpanBuilder<'a>
impl<'a> SpanBuilder<'a>
Sourcepub fn new(
provider: &'a str,
request_model: &'a str,
operation: GenAiOperation,
) -> Self
pub fn new( provider: &'a str, request_model: &'a str, operation: GenAiOperation, ) -> Self
Create a span builder for a provider request.
Sourcepub fn system_instructions(
self,
system_instructions: Option<&'a str>,
record_content: bool,
) -> Self
pub fn system_instructions( self, system_instructions: Option<&'a str>, record_content: bool, ) -> Self
Set the system instructions sent with the request when sensitive content telemetry has been explicitly enabled. Only completion spans record them.
Auto Trait Implementations§
impl<'a> Freeze for SpanBuilder<'a>
impl<'a> RefUnwindSafe for SpanBuilder<'a>
impl<'a> Send for SpanBuilder<'a>
impl<'a> Sync for SpanBuilder<'a>
impl<'a> Unpin for SpanBuilder<'a>
impl<'a> UnsafeUnpin for SpanBuilder<'a>
impl<'a> UnwindSafe for SpanBuilder<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more