Skip to main content

Module types

Module types 

Source
Expand description

类型定义模块,包含AI库的核心数据结构和类型

Types module containing core data structures and type definitions for the AI library.

This module defines the fundamental types used throughout ai-lib:

  • ChatCompletionRequest and ChatCompletionResponse for API communication
  • Message, Role, and Content for conversation modeling
  • AiLibError for comprehensive error handling
  • Tool and FunctionCall for function calling capabilities

Re-exports§

pub use request::ChatCompletionRequest;
pub use response::ChatCompletionResponse;
pub use common::Choice;
pub use common::Message;
pub use common::Role;
pub use error::AiLibError;
pub use function_call::FunctionCall;
pub use function_call::FunctionCallPolicy;
pub use function_call::Tool;
pub use response::Usage;
pub use response::UsageStatus;

Modules§

common
error
错误处理模块,提供统一的错误类型和处理机制
function_call
request
response