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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Defines the `Provider` trait, a core abstraction for AI model providers.
//!
//! This module contains the `Provider` trait, which unifies the behavior of
//! different AI providers like OpenAI, Anthropic, or Google.

use crate::core::language_model::LanguageModel;

/// A marker trait representing a fully configured AI provider.
///
/// The `Provider` trait aggregates all necessary capabilities for a given AI provider,
/// such as `LanguageModel`, and in the future, potentially `ImageModel` or `EmbeddingModel`.
///
/// By implementing `Provider`, a type signals that it is a complete and ready-to-use
/// client for interacting with a specific AI service.
pub trait Provider: Send + Sync + LanguageModel {}