pub struct Descriptor<'a> {
pub replay: Option<&'a dyn ReplayTarget>,
pub name: &'a str,
pub model: Option<&'a str>,
pub capabilities: Capabilities,
pub telemetry: Option<fn(Mode) -> GenAiOperation>,
}Expand description
What a wire says about itself: plain data, read before every call.
Fields§
§replay: Option<&'a dyn ReplayTarget>The model replay shapes a completion history for. Every completion
wire names one; other operations leave it None.
name: &'a strThe provider descriptor name ("anthropic"), as records and
telemetry name it.
model: Option<&'a str>The model id the wire addresses, for telemetry. None for
operations that address no model.
capabilities: CapabilitiesWhat a runtime accounts for.
telemetry: Option<fn(Mode) -> GenAiOperation>The telemetry operation for a call in each mode, when the endpoint
has a canonical name of its own (Gemini generate_content). The mode
itself is recorded separately, as gen_ai.request.stream.
Implementations§
Source§impl<'a> Descriptor<'a>
impl<'a> Descriptor<'a>
Sourcepub fn new(name: &'a str) -> Self
pub fn new(name: &'a str) -> Self
A wire named name, addressing no model, with default capabilities.
Sourcepub fn replay(self, target: &'a dyn ReplayTarget) -> Self
pub fn replay(self, target: &'a dyn ReplayTarget) -> Self
The model replay shapes a completion history for.
Sourcepub fn model(self, model: impl Into<Option<&'a str>>) -> Self
pub fn model(self, model: impl Into<Option<&'a str>>) -> Self
The model id the wire addresses, when it addresses one.
Sourcepub fn capabilities(self, capabilities: Capabilities) -> Self
pub fn capabilities(self, capabilities: Capabilities) -> Self
What a runtime accounts for.
Sourcepub fn telemetry(self, telemetry: fn(Mode) -> GenAiOperation) -> Self
pub fn telemetry(self, telemetry: fn(Mode) -> GenAiOperation) -> Self
The endpoint’s own telemetry operation for each mode.
Trait Implementations§
Source§impl<'a> Clone for Descriptor<'a>
impl<'a> Clone for Descriptor<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Descriptor<'a>
impl<'a> !UnwindSafe for Descriptor<'a>
impl<'a> Freeze for Descriptor<'a>
impl<'a> Send for Descriptor<'a>
impl<'a> Sync for Descriptor<'a>
impl<'a> Unpin for Descriptor<'a>
impl<'a> UnsafeUnpin for Descriptor<'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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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