Expand description
§Chat-RS
A multi-provider LLM framework.
This crate provides a unified, type-safe API for interacting with Large Language Models like Google Gemini, Anthropic Claude, and OpenAI. It features compile-time safe builders, automatic retry loops, and native tool execution.
Modules§
Macros§
Structs§
- Callback
Retry Context - Chat
- Chat
Builder - Chat
Failure - Chat
Options - Chat
Response - Content
- Embeddings
Response - Messages
- Metadata
- Parts
- Provider
Meta - Scoped
Collection - A
ToolCollection<M>paired with a user-defined strategy closure. - Structured
- Tool
- A tool invocation paired with its lifecycle state.
- Unstructured
Enums§
- Action
- The chat loop’s decision vocabulary for what to do with a model-emitted tool call before it runs. Produced by a strategy closure, consumed by the executor.
- Chat
Error - Chat
Outcome - Result of a chat loop iteration. Returned by
Chat::completeandChat::resume. - Part
Enum - Pause
Reason - Why the chat loop paused.
- Tool
Status - Lifecycle of a tool call.
Traits§
- Completion
Provider - Tool declarations are the one and only view providers have into the
user’s tool collections. The trait intentionally exposes nothing
about execution, metadata, or strategy — providers translate
declarations to their wire format and nothing else. For the
builder-side collection API, see
crate::types::tools. - Embeddings
Provider - Typed
Collection - Type-erased view of a tool collection used by the chat loop.