Skip to main content

wabot_feature_chat_bot/
lib.rs

1//! # wabot-feature-chat-bot
2//!
3//! Rust port of `wabot-ts/src/feature/chat-bot`. Owns the canonical
4//! [`Chat`] / [`ChatConnection`] / [`ChatMessage`] data types (Phase 4
5//! relocation: previously in `wabot-feature-chat-controller`), the
6//! [`ChatMemory`] + [`ChatAdapter`] traits, and the [`ChatBot`]
7//! orchestrator that wires a mindset to an LLM provider.
8//!
9//! Phase 4a wires the framework end-to-end with the Anthropic adapter
10//! (`wabot-addon-chat-bot-anthropic`). Subsequent sessions add OpenAI /
11//! Google / DeepSeek / OpenRouter adapters under the same trait.
12
13pub mod adapter;
14pub mod attachments;
15pub mod audio;
16pub mod bot;
17pub mod chat;
18pub mod chat_item;
19pub mod memory;
20pub mod types;
21
22pub use adapter::{
23    ChatAdapter, ChatAdapterError, ChatAdapterRequest, ChatAdapterResponse, LanguageModelUsage,
24    ModelRef, ToolDefinition, ToolParameter,
25};
26pub use attachments::{
27    analyzable_documents, analyzable_images, extract_chat_message_text, file_url,
28    is_chat_message_empty, SupportedMedia,
29};
30pub use audio::{
31    register_synthesizer, register_transcriber, union_synthesizer, union_transcriber,
32    AudioAdapterRegistry, AudioError, AudioFormat, AudioSource, AudioSpeechSynthesizer,
33    AudioTranscriber, Speech, SynthesizeRequest, TranscribeRequest, Transcription,
34};
35pub use bot::{BotReplyFn, ChatBot, ChatBotError, DEFAULT_HISTORY_WINDOW};
36pub use chat::{
37    chat_from_connection, fresh_chat_id, Chat, ChatData, ChatRepository, ChatResolver,
38    InMemoryChatRepository,
39};
40pub use chat_item::{ChatItem, FunctionCall};
41pub use memory::{ChatMemory, InMemoryChatMemory};
42pub use types::{ChatConnection, ChatMessage, ChatMessageFile, ChatType};
43
44/// Re-export for the macro / addon ecosystem.
45pub use async_trait;