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) -> Descriptor<'a>
pub fn new(name: &'a str) -> Descriptor<'a>
A wire named name, addressing no model, with default capabilities.
Sourcepub fn replay(self, target: &'a dyn ReplayTarget) -> Descriptor<'a>
pub fn replay(self, target: &'a dyn ReplayTarget) -> Descriptor<'a>
The model replay shapes a completion history for.
Sourcepub fn model(self, model: impl Into<Option<&'a str>>) -> Descriptor<'a>
pub fn model(self, model: impl Into<Option<&'a str>>) -> Descriptor<'a>
The model id the wire addresses, when it addresses one.
Sourcepub fn capabilities(self, capabilities: Capabilities) -> Descriptor<'a>
pub fn capabilities(self, capabilities: Capabilities) -> Descriptor<'a>
What a runtime accounts for.
Sourcepub fn telemetry(self, telemetry: fn(Mode) -> GenAiOperation) -> Descriptor<'a>
pub fn telemetry(self, telemetry: fn(Mode) -> GenAiOperation) -> Descriptor<'a>
The endpoint’s own telemetry operation for each mode.
Trait Implementations§
Source§impl<'a> Clone for Descriptor<'a>
impl<'a> Clone for Descriptor<'a>
Source§fn clone(&self) -> Descriptor<'a>
fn clone(&self) -> Descriptor<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more