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 andAdapterDispatcher
implementation. Adapter implementations are organized by adapter type under theadapters
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:
- Client
Builder - The builder for the
Client
structure. - Client
Config - The Client configuration used in the configuration builder stage.
- 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 - 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)