pub struct Client<Ext = Nothing, H = Client> { /* private fields */ }Expand description
Generic provider client shared by Rig provider integrations.
Ext stores provider-specific behavior such as URL construction, request
customization, and capabilities. H is the HTTP backend and defaults to
reqwest::Client.
Implementations§
Source§impl<Ext> Client<Ext>
new is pinned to H = reqwest::Client so the call site infers without an explicit H
annotation. Callers who want a different backend should go through Client::builder and
chain ClientBuilder::http_client before ClientBuilder::build.
impl<Ext> Client<Ext>
new is pinned to H = reqwest::Client so the call site infers without an explicit H
annotation. Callers who want a different backend should go through Client::builder and
chain ClientBuilder::http_client before ClientBuilder::build.
Source§impl<Ext, H> Client<Ext, H>
impl<Ext, H> Client<Ext, H>
Source§impl<Ext> Client<Ext>
builder() is anchored on Client<Ext, reqwest::Client> purely as an inference hook so that
provider::Client::builder() resolves without a H annotation. The returned builder itself
has H = Missing, accurately reflecting that no backend has been chosen yet; the eventual
Client produced by build() may end up with any HTTP backend depending on whether
ClientBuilder::http_client was called.
impl<Ext> Client<Ext>
builder() is anchored on Client<Ext, reqwest::Client> purely as an inference hook so that
provider::Client::builder() resolves without a H annotation. The returned builder itself
has H = Missing, accurately reflecting that no backend has been chosen yet; the eventual
Client produced by build() may end up with any HTTP backend depending on whether
ClientBuilder::http_client was called.
Sourcepub fn builder() -> ClientBuilder<<Ext as Provider>::Builder>
pub fn builder() -> ClientBuilder<<Ext as Provider>::Builder>
Start constructing a provider client.
Source§impl<Ext, H> Client<Ext, H>where
Ext: Provider,
impl<Ext, H> Client<Ext, H>where
Ext: Provider,
Sourcepub fn post<S>(&self, path: S) -> Result<Builder, Error>
pub fn post<S>(&self, path: S) -> Result<Builder, Error>
Build a provider-customized POST request for a regular HTTP endpoint.
Sourcepub fn post_sse<S>(&self, path: S) -> Result<Builder, Error>
pub fn post_sse<S>(&self, path: S) -> Result<Builder, Error>
Build a provider-customized POST request for an SSE endpoint.
Source§impl<H> Client<ChatGPTExt, H>
impl<H> Client<ChatGPTExt, H>
Source§impl<T> Client<CohereExt, T>
impl<T> Client<CohereExt, T>
pub fn embeddings<D>(
&self,
model: impl Into<String>,
input_type: &str,
) -> EmbeddingsBuilder<EmbeddingModel<T>, D>where
D: Embed,
Sourcepub fn embedding_model(
&self,
model: impl Into<String>,
input_type: &str,
) -> EmbeddingModel<T>
pub fn embedding_model( &self, model: impl Into<String>, input_type: &str, ) -> EmbeddingModel<T>
Note: default embedding dimension of 0 will be used if model is not known.
If this is the case, it’s better to use function embedding_model_with_ndims
Sourcepub fn embedding_model_with_ndims(
&self,
model: impl Into<String>,
input_type: &str,
ndims: usize,
) -> EmbeddingModel<T>
pub fn embedding_model_with_ndims( &self, model: impl Into<String>, input_type: &str, ndims: usize, ) -> EmbeddingModel<T>
Create an embedding model with the given name and the number of dimensions in the embedding generated by the model.
Source§impl<H> Client<CopilotExt, H>
impl<H> Client<CopilotExt, H>
Source§impl<H> Client<GeminiExt, H>
impl<H> Client<GeminiExt, H>
Sourcepub fn interactions_api(self) -> Client<GeminiInteractionsExt, H>
pub fn interactions_api(self) -> Client<GeminiInteractionsExt, H>
Create an Interactions API client from this GenerateContent client.
Source§impl<H> Client<GeminiInteractionsExt, H>
impl<H> Client<GeminiInteractionsExt, H>
Sourcepub fn generate_content_api(self) -> Client<GeminiExt, H>
pub fn generate_content_api(self) -> Client<GeminiExt, H>
Create a GenerateContent API client from this Interactions client.
Source§impl<T> Client<GeminiInteractionsExt, T>
impl<T> Client<GeminiInteractionsExt, T>
Sourcepub async fn create_interaction(
&self,
request: CreateInteractionRequest,
) -> Result<Interaction, CompletionError>
pub async fn create_interaction( &self, request: CreateInteractionRequest, ) -> Result<Interaction, CompletionError>
Create a new interaction and return the raw response payload.
Sourcepub async fn get_interaction(
&self,
interaction_id: impl AsRef<str>,
) -> Result<Interaction, CompletionError>
pub async fn get_interaction( &self, interaction_id: impl AsRef<str>, ) -> Result<Interaction, CompletionError>
Fetch an interaction by ID (useful for polling background tasks).
Sourcepub async fn stream_interaction_events(
&self,
request: CreateInteractionRequest,
) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
pub async fn stream_interaction_events( &self, request: CreateInteractionRequest, ) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
Start an interaction and stream raw SSE events.
Sourcepub async fn stream_interaction_events_by_id(
&self,
interaction_id: impl AsRef<str>,
last_event_id: Option<&str>,
) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
pub async fn stream_interaction_events_by_id( &self, interaction_id: impl AsRef<str>, last_event_id: Option<&str>, ) -> Result<Pin<Box<dyn Stream<Item = Result<InteractionSseEvent, CompletionError>> + Send>>, CompletionError>
Resume an interaction stream by ID and optional last event ID.
Source§impl Client<LlamafileExt>
impl Client<LlamafileExt>
Sourcepub fn from_url(
base_url: &str,
) -> Result<Client<LlamafileExt>, ProviderClientError>
pub fn from_url( base_url: &str, ) -> Result<Client<LlamafileExt>, ProviderClientError>
Create a client pointing at the given llamafile base URL
(e.g. http://localhost:8080).
Source§impl<T> Client<MiraExt, T>where
T: HttpClientExt + 'static,
impl<T> Client<MiraExt, T>where
T: HttpClientExt + 'static,
Source§impl<H> Client<OpenAIResponsesExt, H>
impl<H> Client<OpenAIResponsesExt, H>
Sourcepub fn with_system_instructions_placement(
self,
placement: SystemInstructionsPlacement,
) -> Client<OpenAIResponsesExt, H>
pub fn with_system_instructions_placement( self, placement: SystemInstructionsPlacement, ) -> Client<OpenAIResponsesExt, H>
Sets where Rig system instructions are placed in Responses requests for
every completion model created from this client. Models capture the
placement when they are created, so models built before this call are
unaffected. See SystemInstructionsPlacement for when each placement applies.
Sourcepub fn with_system_instructions_as_messages(
self,
) -> Client<OpenAIResponsesExt, H>
pub fn with_system_instructions_as_messages( self, ) -> Client<OpenAIResponsesExt, H>
Sends Rig system instructions as system messages in input instead of
as top-level Responses API instructions for every completion model
created from this client. Models built before this call are unaffected.
OpenAI’s Responses API supports instructions, and Rig uses it by
default. Use this compatibility fallback for OpenAI-compatible providers
that reject or ignore top-level instructions.
Sourcepub fn completions_api(self) -> Client<OpenAICompletionsExt, H>
pub fn completions_api(self) -> Client<OpenAICompletionsExt, H>
Create a Completions API client from this Responses API client. Useful for switching to the traditional Chat Completions API.
Source§impl<H> Client<OpenAICompletionsExt, H>
impl<H> Client<OpenAICompletionsExt, H>
Sourcepub fn responses_api(self) -> Client<OpenAIResponsesExt, H>
pub fn responses_api(self) -> Client<OpenAIResponsesExt, H>
Create a Responses API client from this Completions API client. Useful for switching to the newer Responses API. A system-instructions placement configured before switching to the Completions API is restored.
Trait Implementations§
Source§impl<M, Ext, H> AudioGenerationClient for Client<Ext, H>where
Ext: Capabilities<H, AudioGeneration = Capable<M>>,
M: AudioGenerationModel<Client = Client<Ext, H>>,
Available on crate feature audio only.
impl<M, Ext, H> AudioGenerationClient for Client<Ext, H>where
Ext: Capabilities<H, AudioGeneration = Capable<M>>,
M: AudioGenerationModel<Client = Client<Ext, H>>,
audio only.Source§type AudioGenerationModel = M
type AudioGenerationModel = M
Source§fn audio_generation_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as AudioGenerationClient>::AudioGenerationModel
fn audio_generation_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as AudioGenerationClient>::AudioGenerationModel
Source§impl<M, Ext, H> CompletionClient for Client<Ext, H>
impl<M, Ext, H> CompletionClient for Client<Ext, H>
Source§type CompletionModel = M
type CompletionModel = M
Source§fn completion_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as CompletionClient>::CompletionModel
fn completion_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as CompletionClient>::CompletionModel
Source§impl<M, Ext, H> EmbeddingsClient for Client<Ext, H>
impl<M, Ext, H> EmbeddingsClient for Client<Ext, H>
Source§type EmbeddingModel = M
type EmbeddingModel = M
Source§fn embedding_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as EmbeddingsClient>::EmbeddingModel
fn embedding_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as EmbeddingsClient>::EmbeddingModel
Source§fn embedding_model_with_ndims(
&self,
model: impl Into<String>,
ndims: usize,
) -> <Client<Ext, H> as EmbeddingsClient>::EmbeddingModel
fn embedding_model_with_ndims( &self, model: impl Into<String>, ndims: usize, ) -> <Client<Ext, H> as EmbeddingsClient>::EmbeddingModel
Source§fn embeddings<D>(
&self,
model: impl Into<String>,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
fn embeddings<D>(
&self,
model: impl Into<String>,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
Source§fn embeddings_with_ndims<D>(
&self,
model: &str,
ndims: usize,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
fn embeddings_with_ndims<D>(
&self,
model: &str,
ndims: usize,
) -> EmbeddingsBuilder<Self::EmbeddingModel, D>where
D: Embed,
Source§impl<Ext, H> HttpClientExt for Client<Ext, H>
impl<Ext, H> HttpClientExt for Client<Ext, H>
Source§fn send<T, U>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<Response<Pin<Box<dyn Future<Output = Result<U, Error>> + Send>>>, Error>> + WasmCompatSend + 'static
fn send<T, U>( &self, req: Request<T>, ) -> impl Future<Output = Result<Response<Pin<Box<dyn Future<Output = Result<U, Error>> + Send>>>, Error>> + WasmCompatSend + 'static
Source§fn send_multipart<U>(
&self,
req: Request<MultipartForm>,
) -> impl Future<Output = Result<Response<Pin<Box<dyn Future<Output = Result<U, Error>> + Send>>>, Error>> + WasmCompatSend + 'static
fn send_multipart<U>( &self, req: Request<MultipartForm>, ) -> impl Future<Output = Result<Response<Pin<Box<dyn Future<Output = Result<U, Error>> + Send>>>, Error>> + WasmCompatSend + 'static
Source§fn send_streaming<T>(
&self,
req: Request<T>,
) -> impl Future<Output = Result<Response<Pin<Box<dyn WasmCompatSendStream<InnerItem = Result<Bytes, Error>, Item = Result<Bytes, Error>>>>>, Error>> + WasmCompatSend
fn send_streaming<T>( &self, req: Request<T>, ) -> impl Future<Output = Result<Response<Pin<Box<dyn WasmCompatSendStream<InnerItem = Result<Bytes, Error>, Item = Result<Bytes, Error>>>>>, Error>> + WasmCompatSend
bytes::Bytes.)Source§impl<M, Ext, H> ImageGenerationClient for Client<Ext, H>where
Ext: Capabilities<H, ImageGeneration = Capable<M>>,
M: ImageGenerationModel<Client = Client<Ext, H>>,
Available on crate feature image only.
impl<M, Ext, H> ImageGenerationClient for Client<Ext, H>where
Ext: Capabilities<H, ImageGeneration = Capable<M>>,
M: ImageGenerationModel<Client = Client<Ext, H>>,
image only.Source§type ImageGenerationModel = M
type ImageGenerationModel = M
Source§fn image_generation_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as ImageGenerationClient>::ImageGenerationModel
fn image_generation_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as ImageGenerationClient>::ImageGenerationModel
Source§fn custom_image_generation_model(
&self,
model: impl Into<String>,
) -> Self::ImageGenerationModel
fn custom_image_generation_model( &self, model: impl Into<String>, ) -> Self::ImageGenerationModel
Source§impl<M, Ext, H> ModelListingClient for Client<Ext, H>where
Ext: Capabilities<H, ModelListing = Capable<M>> + Clone,
M: ModelLister<H, Client = Client<Ext, H>> + WasmCompatSend + WasmCompatSync + Clone + 'static,
H: WasmCompatSend + WasmCompatSync + Clone,
impl<M, Ext, H> ModelListingClient for Client<Ext, H>where
Ext: Capabilities<H, ModelListing = Capable<M>> + Clone,
M: ModelLister<H, Client = Client<Ext, H>> + WasmCompatSend + WasmCompatSync + Clone + 'static,
H: WasmCompatSend + WasmCompatSync + Clone,
Source§fn list_models(
&self,
) -> impl Future<Output = Result<ModelList, ModelListingError>> + WasmCompatSend
fn list_models( &self, ) -> impl Future<Output = Result<ModelList, ModelListingError>> + WasmCompatSend
Source§impl ProviderClient for Client<AnthropicExt>
impl ProviderClient for Client<AnthropicExt>
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<AnthropicExt>, <Client<AnthropicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<AnthropicExt>, <Client<AnthropicExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<AnthropicExt> as ProviderClient>::Input,
) -> Result<Client<AnthropicExt>, <Client<AnthropicExt> as ProviderClient>::Error>
fn from_val( input: <Client<AnthropicExt> as ProviderClient>::Input, ) -> Result<Client<AnthropicExt>, <Client<AnthropicExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<AzureExt>
impl ProviderClient for Client<AzureExt>
Source§fn from_env() -> Result<Client<AzureExt>, <Client<AzureExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<AzureExt>, <Client<AzureExt> as ProviderClient>::Error>
Create a new Azure OpenAI client from the AZURE_API_KEY or AZURE_TOKEN, AZURE_API_VERSION, and AZURE_ENDPOINT environment variables.
Source§type Input = AzureOpenAIClientParams
type Input = AzureOpenAIClientParams
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<ChatGPTExt>
impl ProviderClient for Client<ChatGPTExt>
Source§type Input = ChatGPTAuth
type Input = ChatGPTAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<ChatGPTExt>, <Client<ChatGPTExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<ChatGPTExt>, <Client<ChatGPTExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<ChatGPTExt> as ProviderClient>::Input,
) -> Result<Client<ChatGPTExt>, <Client<ChatGPTExt> as ProviderClient>::Error>
fn from_val( input: <Client<ChatGPTExt> as ProviderClient>::Input, ) -> Result<Client<ChatGPTExt>, <Client<ChatGPTExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<CohereExt>
impl ProviderClient for Client<CohereExt>
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<CopilotExt>
impl ProviderClient for Client<CopilotExt>
Source§type Input = CopilotAuth
type Input = CopilotAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<CopilotExt>, <Client<CopilotExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<CopilotExt>, <Client<CopilotExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<CopilotExt> as ProviderClient>::Input,
) -> Result<Client<CopilotExt>, <Client<CopilotExt> as ProviderClient>::Error>
fn from_val( input: <Client<CopilotExt> as ProviderClient>::Input, ) -> Result<Client<CopilotExt>, <Client<CopilotExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<DeepSeekExt>
impl ProviderClient for Client<DeepSeekExt>
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<DeepSeekExt>, <Client<DeepSeekExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<DeepSeekExt>, <Client<DeepSeekExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<DeepSeekExt> as ProviderClient>::Input,
) -> Result<Client<DeepSeekExt>, <Client<DeepSeekExt> as ProviderClient>::Error>
fn from_val( input: <Client<DeepSeekExt> as ProviderClient>::Input, ) -> Result<Client<DeepSeekExt>, <Client<DeepSeekExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<DoublewordExt>
impl ProviderClient for Client<DoublewordExt>
Source§fn from_env() -> Result<Client<DoublewordExt>, <Client<DoublewordExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<DoublewordExt>, <Client<DoublewordExt> as ProviderClient>::Error>
Create a new Doubleword client from the DOUBLEWORD_API_KEY environment
variable. The base URL can optionally be overridden with
DOUBLEWORD_BASE_URL (defaults to https://api.doubleword.ai/v1).
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<DoublewordExt> as ProviderClient>::Input,
) -> Result<Client<DoublewordExt>, <Client<DoublewordExt> as ProviderClient>::Error>
fn from_val( input: <Client<DoublewordExt> as ProviderClient>::Input, ) -> Result<Client<DoublewordExt>, <Client<DoublewordExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<GeminiExt>
impl ProviderClient for Client<GeminiExt>
Source§fn from_env() -> Result<Client<GeminiExt>, <Client<GeminiExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<GeminiExt>, <Client<GeminiExt> as ProviderClient>::Error>
Create a new Google Gemini client from the GEMINI_API_KEY environment variable.
Source§type Input = GeminiApiKey
type Input = GeminiApiKey
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<GeminiInteractionsExt>
impl ProviderClient for Client<GeminiInteractionsExt>
Source§fn from_env() -> Result<Client<GeminiInteractionsExt>, <Client<GeminiInteractionsExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<GeminiInteractionsExt>, <Client<GeminiInteractionsExt> as ProviderClient>::Error>
Create a new Google Gemini interactions client from the GEMINI_API_KEY environment variable.
Source§type Input = GeminiApiKey
type Input = GeminiApiKey
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<GeminiInteractionsExt> as ProviderClient>::Input,
) -> Result<Client<GeminiInteractionsExt>, <Client<GeminiInteractionsExt> as ProviderClient>::Error>
fn from_val( input: <Client<GeminiInteractionsExt> as ProviderClient>::Input, ) -> Result<Client<GeminiInteractionsExt>, <Client<GeminiInteractionsExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<GroqExt>
impl ProviderClient for Client<GroqExt>
Source§fn from_env() -> Result<Client<GroqExt>, <Client<GroqExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<GroqExt>, <Client<GroqExt> as ProviderClient>::Error>
Create a new Groq client from the GROQ_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<HuggingFaceExt>
impl ProviderClient for Client<HuggingFaceExt>
Source§fn from_env() -> Result<Client<HuggingFaceExt>, <Client<HuggingFaceExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<HuggingFaceExt>, <Client<HuggingFaceExt> as ProviderClient>::Error>
Create a new Huggingface client from the HUGGINGFACE_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<HuggingFaceExt> as ProviderClient>::Input,
) -> Result<Client<HuggingFaceExt>, <Client<HuggingFaceExt> as ProviderClient>::Error>
fn from_val( input: <Client<HuggingFaceExt> as ProviderClient>::Input, ) -> Result<Client<HuggingFaceExt>, <Client<HuggingFaceExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<HyperbolicExt>
impl ProviderClient for Client<HyperbolicExt>
Source§fn from_env() -> Result<Client<HyperbolicExt>, <Client<HyperbolicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<HyperbolicExt>, <Client<HyperbolicExt> as ProviderClient>::Error>
Create a new Hyperbolic client from the HYPERBOLIC_API_KEY environment variable.
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<HyperbolicExt> as ProviderClient>::Input,
) -> Result<Client<HyperbolicExt>, <Client<HyperbolicExt> as ProviderClient>::Error>
fn from_val( input: <Client<HyperbolicExt> as ProviderClient>::Input, ) -> Result<Client<HyperbolicExt>, <Client<HyperbolicExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<LlamafileExt>
impl ProviderClient for Client<LlamafileExt>
Source§type Input = Nothing
type Input = Nothing
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<LlamafileExt>, <Client<LlamafileExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<LlamafileExt>, <Client<LlamafileExt> as ProviderClient>::Error>
Source§fn from_val(
_: <Client<LlamafileExt> as ProviderClient>::Input,
) -> Result<Client<LlamafileExt>, <Client<LlamafileExt> as ProviderClient>::Error>
fn from_val( _: <Client<LlamafileExt> as ProviderClient>::Input, ) -> Result<Client<LlamafileExt>, <Client<LlamafileExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<MiniMaxExt>
impl ProviderClient for Client<MiniMaxExt>
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<MiniMaxExt>, <Client<MiniMaxExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MiniMaxExt>, <Client<MiniMaxExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<MiniMaxExt> as ProviderClient>::Input,
) -> Result<Client<MiniMaxExt>, <Client<MiniMaxExt> as ProviderClient>::Error>
fn from_val( input: <Client<MiniMaxExt> as ProviderClient>::Input, ) -> Result<Client<MiniMaxExt>, <Client<MiniMaxExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<MiniMaxAnthropicExt>
impl ProviderClient for Client<MiniMaxAnthropicExt>
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<MiniMaxAnthropicExt>, <Client<MiniMaxAnthropicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MiniMaxAnthropicExt>, <Client<MiniMaxAnthropicExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<MiniMaxAnthropicExt> as ProviderClient>::Input,
) -> Result<Client<MiniMaxAnthropicExt>, <Client<MiniMaxAnthropicExt> as ProviderClient>::Error>
fn from_val( input: <Client<MiniMaxAnthropicExt> as ProviderClient>::Input, ) -> Result<Client<MiniMaxAnthropicExt>, <Client<MiniMaxAnthropicExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<MiraExt>
impl ProviderClient for Client<MiraExt>
Source§fn from_env() -> Result<Client<MiraExt>, <Client<MiraExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MiraExt>, <Client<MiraExt> as ProviderClient>::Error>
Create a new Mira client from the MIRA_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<MistralExt>
impl ProviderClient for Client<MistralExt>
Source§fn from_env() -> Result<Client<MistralExt>, <Client<MistralExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MistralExt>, <Client<MistralExt> as ProviderClient>::Error>
Create a new Mistral client from the MISTRAL_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<MistralExt> as ProviderClient>::Input,
) -> Result<Client<MistralExt>, <Client<MistralExt> as ProviderClient>::Error>
fn from_val( input: <Client<MistralExt> as ProviderClient>::Input, ) -> Result<Client<MistralExt>, <Client<MistralExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<MoonshotExt>
impl ProviderClient for Client<MoonshotExt>
Source§fn from_env() -> Result<Client<MoonshotExt>, <Client<MoonshotExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MoonshotExt>, <Client<MoonshotExt> as ProviderClient>::Error>
Create a new Moonshot client from the MOONSHOT_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<MoonshotExt> as ProviderClient>::Input,
) -> Result<Client<MoonshotExt>, <Client<MoonshotExt> as ProviderClient>::Error>
fn from_val( input: <Client<MoonshotExt> as ProviderClient>::Input, ) -> Result<Client<MoonshotExt>, <Client<MoonshotExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<MoonshotAnthropicExt>
impl ProviderClient for Client<MoonshotAnthropicExt>
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<MoonshotAnthropicExt>, <Client<MoonshotAnthropicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<MoonshotAnthropicExt>, <Client<MoonshotAnthropicExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<MoonshotAnthropicExt> as ProviderClient>::Input,
) -> Result<Client<MoonshotAnthropicExt>, <Client<MoonshotAnthropicExt> as ProviderClient>::Error>
fn from_val( input: <Client<MoonshotAnthropicExt> as ProviderClient>::Input, ) -> Result<Client<MoonshotAnthropicExt>, <Client<MoonshotAnthropicExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<OllamaExt>
impl ProviderClient for Client<OllamaExt>
Source§type Input = OllamaApiKey
type Input = OllamaApiKey
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<OpenAIResponsesExt>
impl ProviderClient for Client<OpenAIResponsesExt>
Source§fn from_env() -> Result<Client<OpenAIResponsesExt>, <Client<OpenAIResponsesExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<OpenAIResponsesExt>, <Client<OpenAIResponsesExt> as ProviderClient>::Error>
Create a new OpenAI Responses API client from the OPENAI_API_KEY environment variable.
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<OpenAIResponsesExt> as ProviderClient>::Input,
) -> Result<Client<OpenAIResponsesExt>, <Client<OpenAIResponsesExt> as ProviderClient>::Error>
fn from_val( input: <Client<OpenAIResponsesExt> as ProviderClient>::Input, ) -> Result<Client<OpenAIResponsesExt>, <Client<OpenAIResponsesExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<OpenAICompletionsExt>
impl ProviderClient for Client<OpenAICompletionsExt>
Source§fn from_env() -> Result<Client<OpenAICompletionsExt>, <Client<OpenAICompletionsExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<OpenAICompletionsExt>, <Client<OpenAICompletionsExt> as ProviderClient>::Error>
Create a new OpenAI Completions API client from the OPENAI_API_KEY environment variable.
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<OpenAICompletionsExt> as ProviderClient>::Input,
) -> Result<Client<OpenAICompletionsExt>, <Client<OpenAICompletionsExt> as ProviderClient>::Error>
fn from_val( input: <Client<OpenAICompletionsExt> as ProviderClient>::Input, ) -> Result<Client<OpenAICompletionsExt>, <Client<OpenAICompletionsExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<OpenRouterExt>
impl ProviderClient for Client<OpenRouterExt>
Source§fn from_env() -> Result<Client<OpenRouterExt>, <Client<OpenRouterExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<OpenRouterExt>, <Client<OpenRouterExt> as ProviderClient>::Error>
Create a new openrouter client from the OPENROUTER_API_KEY environment variable.
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<OpenRouterExt> as ProviderClient>::Input,
) -> Result<Client<OpenRouterExt>, <Client<OpenRouterExt> as ProviderClient>::Error>
fn from_val( input: <Client<OpenRouterExt> as ProviderClient>::Input, ) -> Result<Client<OpenRouterExt>, <Client<OpenRouterExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<PerplexityExt>
impl ProviderClient for Client<PerplexityExt>
Source§fn from_env() -> Result<Client<PerplexityExt>, <Client<PerplexityExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<PerplexityExt>, <Client<PerplexityExt> as ProviderClient>::Error>
Create a new Perplexity client from the PERPLEXITY_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<PerplexityExt> as ProviderClient>::Input,
) -> Result<Client<PerplexityExt>, <Client<PerplexityExt> as ProviderClient>::Error>
fn from_val( input: <Client<PerplexityExt> as ProviderClient>::Input, ) -> Result<Client<PerplexityExt>, <Client<PerplexityExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<TogetherExt>
impl ProviderClient for Client<TogetherExt>
Source§fn from_env() -> Result<Client<TogetherExt>, <Client<TogetherExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<TogetherExt>, <Client<TogetherExt> as ProviderClient>::Error>
Create a new Together AI client from the TOGETHER_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_val(
input: <Client<TogetherExt> as ProviderClient>::Input,
) -> Result<Client<TogetherExt>, <Client<TogetherExt> as ProviderClient>::Error>
fn from_val( input: <Client<TogetherExt> as ProviderClient>::Input, ) -> Result<Client<TogetherExt>, <Client<TogetherExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<VoyageExt>
impl ProviderClient for Client<VoyageExt>
Source§fn from_env() -> Result<Client<VoyageExt>, <Client<VoyageExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<VoyageExt>, <Client<VoyageExt> as ProviderClient>::Error>
Create a new OpenAI client from the OPENAI_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<XAiExt>
impl ProviderClient for Client<XAiExt>
Source§fn from_env() -> Result<Client<XAiExt>, <Client<XAiExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<XAiExt>, <Client<XAiExt> as ProviderClient>::Error>
Create a new xAI client from the XAI_API_KEY environment variable.
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<XiaomiMimoExt>
impl ProviderClient for Client<XiaomiMimoExt>
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<XiaomiMimoExt>, <Client<XiaomiMimoExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<XiaomiMimoExt>, <Client<XiaomiMimoExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<XiaomiMimoExt> as ProviderClient>::Input,
) -> Result<Client<XiaomiMimoExt>, <Client<XiaomiMimoExt> as ProviderClient>::Error>
fn from_val( input: <Client<XiaomiMimoExt> as ProviderClient>::Input, ) -> Result<Client<XiaomiMimoExt>, <Client<XiaomiMimoExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<XiaomiMimoAnthropicExt>
impl ProviderClient for Client<XiaomiMimoAnthropicExt>
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<XiaomiMimoAnthropicExt>, <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<XiaomiMimoAnthropicExt>, <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Input,
) -> Result<Client<XiaomiMimoAnthropicExt>, <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Error>
fn from_val( input: <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Input, ) -> Result<Client<XiaomiMimoAnthropicExt>, <Client<XiaomiMimoAnthropicExt> as ProviderClient>::Error>
Source§impl ProviderClient for Client<ZAiExt>
impl ProviderClient for Client<ZAiExt>
Source§type Input = BearerAuth
type Input = BearerAuth
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§impl ProviderClient for Client<ZAiAnthropicExt>
impl ProviderClient for Client<ZAiAnthropicExt>
Source§type Input = String
type Input = String
ProviderClient::from_val.Source§type Error = ProviderClientError
type Error = ProviderClientError
Source§fn from_env() -> Result<Client<ZAiAnthropicExt>, <Client<ZAiAnthropicExt> as ProviderClient>::Error>
fn from_env() -> Result<Client<ZAiAnthropicExt>, <Client<ZAiAnthropicExt> as ProviderClient>::Error>
Source§fn from_val(
input: <Client<ZAiAnthropicExt> as ProviderClient>::Input,
) -> Result<Client<ZAiAnthropicExt>, <Client<ZAiAnthropicExt> as ProviderClient>::Error>
fn from_val( input: <Client<ZAiAnthropicExt> as ProviderClient>::Input, ) -> Result<Client<ZAiAnthropicExt>, <Client<ZAiAnthropicExt> as ProviderClient>::Error>
Source§impl<M, Ext, H> RerankingClient for Client<Ext, H>
impl<M, Ext, H> RerankingClient for Client<Ext, H>
Source§type RerankModel = M
type RerankModel = M
RerankModel used by the Client.Source§fn rerank_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as RerankingClient>::RerankModel
fn rerank_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as RerankingClient>::RerankModel
Source§impl<M, Ext, H> TranscriptionClient for Client<Ext, H>where
Ext: Capabilities<H, Transcription = Capable<M>>,
M: TranscriptionModel<Client = Client<Ext, H>> + WasmCompatSend,
impl<M, Ext, H> TranscriptionClient for Client<Ext, H>where
Ext: Capabilities<H, Transcription = Capable<M>>,
M: TranscriptionModel<Client = Client<Ext, H>> + WasmCompatSend,
Source§type TranscriptionModel = M
type TranscriptionModel = M
Source§fn transcription_model(
&self,
model: impl Into<String>,
) -> <Client<Ext, H> as TranscriptionClient>::TranscriptionModel
fn transcription_model( &self, model: impl Into<String>, ) -> <Client<Ext, H> as TranscriptionClient>::TranscriptionModel
Source§impl<Ext, H> VerifyClient for Client<Ext, H>
impl<Ext, H> VerifyClient for Client<Ext, H>
Auto Trait Implementations§
impl<Ext, H> Freeze for Client<Ext, H>
impl<Ext, H> RefUnwindSafe for Client<Ext, H>where
H: RefUnwindSafe,
Ext: RefUnwindSafe,
impl<Ext, H> Send for Client<Ext, H>
impl<Ext, H> Sync for Client<Ext, H>
impl<Ext, H> Unpin for Client<Ext, H>
impl<Ext, H> UnsafeUnpin for Client<Ext, H>where
H: UnsafeUnpin,
Ext: UnsafeUnpin,
impl<Ext, H> UnwindSafe for Client<Ext, H>where
H: UnwindSafe,
Ext: UnwindSafe,
Blanket Implementations§
Source§impl<C> AgentClientExt for Cwhere
C: CompletionClient,
impl<C> AgentClientExt for Cwhere
C: CompletionClient,
Source§fn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
fn agent(&self, model: impl Into<String>) -> AgentBuilder<Self::CompletionModel>
model.Source§fn 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,
model.