Skip to main content

Crate chat_rs

Crate chat_rs 

Source
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§

prelude
types

Macros§

retry_strategy

Structs§

CallbackRetryContext
Chat
ChatBuilder
ChatFailure
ChatOptions
ChatResponse
Content
EmbeddingsResponse
Messages
Metadata
Parts
ProviderMeta
ScopedCollection
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.
ChatError
ChatOutcome
Result of a chat loop iteration. Returned by Chat::complete and Chat::resume.
PartEnum
PauseReason
Why the chat loop paused.
ToolStatus
Lifecycle of a tool call.

Traits§

CompletionProvider
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.
EmbeddingsProvider
TypedCollection
Type-erased view of a tool collection used by the chat loop.

Type Aliases§

CallbackStrategy
RetryStrategy