pub struct CompletionSpanBuilder<'a> { /* private fields */ }Expand description
Builder for a canonical GenAI completion span.
Runtime spans declaring COMPLETION_PARENT_MARKER_FIELD and the
COMPLETION_PARENT_REQUIRED_FIELDS are enriched and reused so one model
turn has exactly one model span. Other ambient spans — and marker spans that
omit a required field — remain parents of a newly created rig::completions
span.
Implementations§
Source§impl<'a> CompletionSpanBuilder<'a>
impl<'a> CompletionSpanBuilder<'a>
Sourcepub fn new(
provider: &'a str,
request_model: &'a str,
operation: CompletionOperation,
) -> Self
pub fn new( provider: &'a str, request_model: &'a str, operation: CompletionOperation, ) -> Self
Create a completion-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.
Auto Trait Implementations§
impl<'a> Freeze for CompletionSpanBuilder<'a>
impl<'a> RefUnwindSafe for CompletionSpanBuilder<'a>
impl<'a> Send for CompletionSpanBuilder<'a>
impl<'a> Sync for CompletionSpanBuilder<'a>
impl<'a> Unpin for CompletionSpanBuilder<'a>
impl<'a> UnsafeUnpin for CompletionSpanBuilder<'a>
impl<'a> UnwindSafe for CompletionSpanBuilder<'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> 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