Module client

Module client 

Source
Expand description

This module provides traits for defining and creating provider clients. Clients are used to create models for completion, embeddings, etc. Dyn-compatible traits have been provided to allow for more provider-agnostic code.

Re-exports§

pub use completion::CompletionClient;
pub use embeddings::EmbeddingsClient;
pub use verify::VerifyClient;
pub use verify::VerifyError;

Modules§

audio_generation
builder
completion
embeddings
image_generation
transcription
verify

Structs§

BearerAuth
An API key which will be inserted into a Client’s default headers as a bearer auth token
Capable
A wrapper type providing runtime checks on a provider’s capabilities via the Capability trait
Client
ClientBuilder
FinalCompletionResponse
The final streaming response from a dynamic client.
NeedsApiKey
Nothing
A type containing nothing at all. For Option-like behavior on the type level, i.e. to describe the lack of an API key in a ClientBuilder

Enums§

ClientBuilderError
Transport

Traits§

ApiKey
A trait for API keys. This determines whether the key is inserted into a Client’s default headers (in the Some case) or handled by a given provider extension (in the None case)
Capabilities
The capabilities of a given provider, i.e. embeddings, audio transcriptions, text completion
Capability
DebugExt
Provider
An API provider extension, this abstracts over extensions which may be use in conjunction with the Client<Ext, H> struct to define the behavior of a provider with respect to networking, auth, instantiating models
ProviderBuilder
An API provider extension builder, this abstracts over provider-specific builders which are able to configure and produce a given provider’s extension type
ProviderClient
Abstracts over the ability to instantiate a client, either via environment variables or some Self::Input