Crate genai

Source
Expand description

genai library - A client library for any AI provider. See examples/c00-readme.rs

Modules§

adapter
The Adapter layer allows adapting client requests/responses to various AI providers. Currently, it employs a static dispatch pattern with the Adapter trait and AdapterDispatcher implementation. Adapter implementations are organized by adapter type under the adapters submodule.
chat
The genai chat module contains all of the constructs necessary to make genai requests with the genai::Client.
resolver
Resolvers are hooks that library users can set to customize aspects of the library’s default behavior. A good example is the AuthResolver, which provides the authentication data (e.g., api_key).
webc
The GenAI web client construct that uses reqwest. Only webc::Error is exposed as the public interface.

Structs§

Client
genai Client for executing AI requests to any providers. Built with:
ClientBuilder
The builder for the Client structure.
ClientConfig
The Client configuration used in the configuration builder stage.
ModelIden
Holds the adapter kind and model name in an efficient, clonable way.
ModelName
The model name, which is just an Arc<str> wrapper (simple and relatively efficient to clone)
ServiceTarget
A ServiceTarget represents the destination and necessary details for making a service call.

Enums§

Error
Main GenAI error

Type Aliases§

Result
GenAI main Result type alias (with genai::Error)