Expand description
grain-llm-genai — genai-backed grain_agent_core::LlmStream implementation.
Bridges the transport-agnostic agent loop in grain-agent-core to the
genai crate’s multi-provider chat API.
mapping::outbound—LlmContext→genai::chat::ChatRequest, including Anthropic-style signed-thinking replay.mapping::inbound—genai::chat::ChatStreamEvent→AssistantMessageEventvia theInboundStatestate machine.stream—GenaiStream, the [LlmStream] implementation.builder—GenaiStreamBuilder: env-var API-key resolver, OpenAI-compat endpoint routing, optionalgrain_llm_models::Registrywiring.config— small config types (EnvKeyResolver,OpenAiCompatEndpoint,OpenAiCompatPreset,ProviderRouter).
Re-exports§
pub use builder::GenaiStreamBuilder;pub use config::EnvKeyResolver;pub use config::OpenAiCompatEndpoint;pub use config::OpenAiCompatPreset;pub use config::ProviderRouter;pub use mapping::inbound::InboundState;pub use mapping::outbound::baseline_chat_options;pub use mapping::outbound::to_chat_request;pub use mapping::usage::map_usage;pub use provider::AuthEntry;pub use provider::ProfileEntry;pub use provider::ProviderAuth;pub use provider::ProviderKind;pub use provider::ProviderProfile;pub use provider::load_profiles;pub use provider::profile_from_entry;pub use provider::resolve_providers_file;pub use stream::GenaiStream;
Modules§
- builder
- Fluent builder for
crate::stream::GenaiStream. - config
- Configuration types for
crate::stream::GenaiStream. - mapping
- Translation between
grain-agent-coretypes andgenaichat types. - oauth
- OAuth 2.0 PKCE flows for provider subscription plans.
- provider
- Provider profile model + TOML loader.
- stream
grain_agent_core::LlmStreamimplementation backed bygenai 0.5.