Crate genai

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
Chat primitives and utilities for building requests and streaming responses. Intended for use with genai::Client
embed
The genai embed module contains all of the constructs necessary to make embedding 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
Client for sending AI requests to supported providers.
ClientBuilder
Builder for Client.
ClientConfig
Configuration for building and customizing a Client.
Headers
A map of HTTP headers (single value per name). Headers can be layered; later values override earlier ones.
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
Service call target.
WebConfig
Reqwest client configuration.

Enums§

Error
Main GenAI error

Type Aliases§

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