ai_lib/types/
mod.rs

1//! 类型定义模块,包含AI库的核心数据结构和类型
2//!
3//! Types module containing core data structures and type definitions for the AI library.
4//!
5//! This module defines the fundamental types used throughout ai-lib:
6//! - `ChatCompletionRequest` and `ChatCompletionResponse` for API communication
7//! - `Message`, `Role`, and `Content` for conversation modeling
8//! - `AiLibError` for comprehensive error handling
9//! - `Tool` and `FunctionCall` for function calling capabilities
10
11pub mod common;
12pub mod error;
13pub mod request;
14pub mod response;
15
16pub use request::ChatCompletionRequest;
17pub use response::ChatCompletionResponse;
18pub mod function_call;
19pub use common::{Choice, Message, Role};
20pub use error::AiLibError;
21pub use function_call::{FunctionCall, FunctionCallPolicy, Tool};
22/// Usage and UsageStatus are response-level metadata; prefer importing from
23/// `ai_lib::types::response::{Usage, UsageStatus}` or the crate root re-exports.
24pub use response::{Usage, UsageStatus};
25
26// Additional code may follow