pub trait AgentClientExt: CompletionClient {
// Provided methods
fn agent(
&self,
model: impl Into<String>,
) -> AgentBuilder<Self::CompletionModel> { ... }
fn extractor<T>(
&self,
model: impl Into<String>,
) -> ExtractorBuilder<Self::CompletionModel, T>
where T: JsonSchema + for<'de> Deserialize<'de> + Serialize + WasmCompatSend + WasmCompatSync + 'static { ... }
}Expand description
Classic-runtime construction sugar layered on any portable completion client.
Builds on completion_model / CompletionModel from its supertrait bound
rig_core::client::completion::CompletionClient and adds the classic
runtime’s agent and extractor builders. The supertrait bound is what lets
the default bodies call self.completion_model(..), so nothing needs
re-forwarding if the portable trait grows a method.
Provider authors implement the portable
rig_core::client::completion::CompletionClient; this extension trait is
blanket-implemented for every type that does. Callers need both traits in
scope to use the full surface — importing AgentClientExt alone does not
bring completion_model into method-resolution scope, since that method
belongs to the supertrait. use rig::prelude::*; brings both in at once for
the full completion_model + agent + extractor surface.
Provided Methods§
Sourcefn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
fn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
Construct a classic agent builder for model.
Sourcefn extractor<T>(
&self,
model: impl Into<String>,
) -> ExtractorBuilder<Self::CompletionModel, T>where
T: JsonSchema + for<'de> Deserialize<'de> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
fn extractor<T>(
&self,
model: impl Into<String>,
) -> ExtractorBuilder<Self::CompletionModel, T>where
T: JsonSchema + for<'de> Deserialize<'de> + Serialize + WasmCompatSend + WasmCompatSync + 'static,
Construct a classic typed extractor builder for model.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".