Skip to main content

robit_ai/
lib.rs

1//! robit-ai: LLM API layer for the Robit framework.
2//!
3//! Provides a unified `LlmClient` for interacting with multiple LLM providers
4//! through the OpenAI-compatible protocol. Configuration is loaded from
5//! `.robit/config.toml` (project-local) or `~/.robit/config.toml` (global).
6
7pub mod client;
8pub mod config;
9pub mod error;
10pub mod logging;
11
12// Re-export async-openai core types so downstream crates don't need to depend on async-openai directly.
13pub use async_openai::types::chat::{
14    ChatCompletionMessageToolCall, ChatCompletionRequestAssistantMessage,
15    ChatCompletionRequestMessage, ChatCompletionRequestSystemMessage,
16    ChatCompletionRequestUserMessage, ChatCompletionRequestUserMessageContent,
17    ChatCompletionRequestUserMessageContentPart,
18    ChatCompletionRequestMessageContentPartText,
19    ChatCompletionRequestMessageContentPartImage,
20    ChatCompletionResponseStream, ChatCompletionTools,
21    CompletionUsage, CreateChatCompletionResponse, CreateChatCompletionStreamResponse, Role,
22};
23
24pub use client::LlmClient;
25pub use config::{
26    load_config, load_env, AppConfig, BotConfig, ChannelsConfig, ConfirmKeywordsConfig,
27    ContextConfig, ModelConfig, ProviderConfig, QqBotConfig, ResolvedModel, RetryConfig,
28    RobitConfig,
29};
30pub use error::LlmError;
31pub use logging::{init_logging, init_logging_silent};