Skip to main content

Crate wabot_feature_chat_bot

Crate wabot_feature_chat_bot 

Source
Expand description

§wabot-feature-chat-bot

Rust port of wabot-ts/src/feature/chat-bot. Owns the canonical Chat / ChatConnection / ChatMessage data types (Phase 4 relocation: previously in wabot-feature-chat-controller), the ChatMemory + ChatAdapter traits, and the ChatBot orchestrator that wires a mindset to an LLM provider.

Phase 4a wires the framework end-to-end with the Anthropic adapter (wabot-addon-chat-bot-anthropic). Subsequent sessions add OpenAI / Google / DeepSeek / OpenRouter adapters under the same trait.

Re-exports§

pub use adapter::ChatAdapter;
pub use adapter::ChatAdapterError;
pub use adapter::ChatAdapterRequest;
pub use adapter::ChatAdapterResponse;
pub use adapter::LanguageModelUsage;
pub use adapter::ModelRef;
pub use adapter::ToolDefinition;
pub use adapter::ToolParameter;
pub use attachments::analyzable_documents;
pub use attachments::analyzable_images;
pub use attachments::extract_chat_message_text;
pub use attachments::file_url;
pub use attachments::is_chat_message_empty;
pub use attachments::SupportedMedia;
pub use audio::register_synthesizer;
pub use audio::register_transcriber;
pub use audio::union_synthesizer;
pub use audio::union_transcriber;
pub use audio::AudioAdapterRegistry;
pub use audio::AudioError;
pub use audio::AudioFormat;
pub use audio::AudioSource;
pub use audio::AudioSpeechSynthesizer;
pub use audio::AudioTranscriber;
pub use audio::Speech;
pub use audio::SynthesizeRequest;
pub use audio::TranscribeRequest;
pub use audio::Transcription;
pub use bot::BotReplyFn;
pub use bot::ChatBot;
pub use bot::ChatBotError;
pub use bot::DEFAULT_HISTORY_WINDOW;
pub use chat::chat_from_connection;
pub use chat::fresh_chat_id;
pub use chat::Chat;
pub use chat::ChatData;
pub use chat::ChatRepository;
pub use chat::ChatResolver;
pub use chat::InMemoryChatRepository;
pub use chat_item::ChatItem;
pub use chat_item::FunctionCall;
pub use memory::ChatMemory;
pub use memory::InMemoryChatMemory;
pub use types::ChatConnection;
pub use types::ChatMessage;
pub use types::ChatMessageFile;
pub use types::ChatType;
pub use async_trait;

Modules§

adapter
ChatAdapter — what every LLM addon implements. Mirrors IChatAdapter / IChatAdapterNextItemsReq / IChatAdapterNextItemsRes in TS.
attachments
What an adapter does with an image or a document. Port of extractChatMessageText in wabot-ts.
audio
Voice in, voice out. Port of IAudioTranscriber, IAudioSpeechSynthesizer, AudioAdapterRegistry and the two Union* adapters in wabot-ts.
bot
ChatBot orchestrator — mirrors ChatBot.processLoop in TS.
chat
Chat entity + in-memory ChatRepository + ChatResolver.
chat_item
ChatItem — one entry in a chat’s memory. Mirrors IChatItem (IBotMessageItem | IHumanMessageItem | IFunctionCallItem) and the ChatItem Entity class from TS.
memory
ChatMemory — append-and-tail-read storage for ChatItems, per chat. Mirrors ChatMemory / IChatMemory in TS.
types
Connection + message data types shared by every chat surface.