aisdk 0.5.2

An open-source Rust library for building AI-powered applications, inspired by the Vercel AI SDK. It provides a robust, type-safe, and easy-to-use interface for interacting with various Large Language Models (LLMs).
Documentation
//! The core components of the AI SDK, including traits, types, and the main generation function.
//!
//! This module provides the essential building blocks for interacting with language models.
//! It defines the `LanguageModel` trait, which all model providers must implement,
//! and includes the primary `generate_text` function for initiating text generation.
//!
//! Key types like `GenerateTextCallOptions` and `GenerateTextResponse` are also
//! re-exported for convenient access.

pub mod capabilities;
pub mod client;
pub mod embedding_model;
pub mod language_model;
pub mod messages;
pub mod provider;
pub mod tools;
pub mod utils;

// Re-export key components to provide a clean public API.
pub use capabilities::DynamicModel;
pub use language_model::{LanguageModel, LanguageModelStreamChunkType};
#[cfg(feature = "language-model-request")]
pub use language_model::{
    generate_text::GenerateTextResponse, request::LanguageModelRequest,
    stream_text::StreamTextResponse,
};

pub use embedding_model::EmbeddingModel;
#[cfg(feature = "embedding-model-request")]
pub use embedding_model::EmbeddingModelRequest;

pub use messages::{AssistantMessage, Message, Messages, Role, SystemMessage, UserMessage};
pub use provider::Provider;
pub use tools::{Tool, ToolCallInfo, ToolResultInfo};