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
Adaptertrait andAdapterDispatcherimplementation. Adapter implementations are organized by adapter type under theadapterssubmodule. - 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::Erroris exposed as the public interface.
Structs§
- Client
- Client for sending AI requests to supported providers.
- Client
Builder - Builder for
Client. - Client
Config - 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.
- Model
Iden - Holds the adapter kind and model name in an efficient, clonable way.
- Model
Name - The model name, which is just an
Arc<str>wrapper (simple and relatively efficient to clone) - Service
Target - Service call target.
- WebConfig
- Reqwest client configuration.
Enums§
- Error
- Main GenAI error
Type Aliases§
- Result
- GenAI main Result type alias (with genai::Error)