rig/providers/
mod.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! This module contains clients for the different LLM providers that Rig supports.
//!
//! Currently, the following providers are supported:
//! - Cohere
//! - OpenAI
//! - Perplexity
//! - Anthropic
//! - Google Gemini
//! - xAI
//! - EternalAI
//! - DeepSeek
//!
//! Each provider has its own module, which contains a `Client` implementation that can
//! be used to initialize completion and embedding models and execute requests to those models.
//!
//! The clients also contain methods to easily create higher level AI constructs such as
//! agents and RAG systems, reducing the need for boilerplate.
//!
//! # Example
//! ```
//! use rig::{providers::openai, agent::AgentBuilder};
//!
//! // Initialize the OpenAI client
//! let openai = openai::Client::new("your-openai-api-key");
//!
//! // Create a model and initialize an agent
//! let gpt_4o = openai.completion_model("gpt-4o");
//!
//! let agent = AgentBuilder::new(gpt_4o)
//!     .preamble("\
//!         You are Gandalf the white and you will be conversing with other \
//!         powerful beings to discuss the fate of Middle Earth.\
//!     ")
//!     .build();
//!
//! // Alternatively, you can initialize an agent directly
//! let agent = openai.agent("gpt-4o")
//!     .preamble("\
//!         You are Gandalf the white and you will be conversing with other \
//!         powerful beings to discuss the fate of Middle Earth.\
//!     ")
//!     .build();
//! ```
//! Note: The example above uses the OpenAI provider client, but the same pattern can
//! be used with the Cohere provider client.
pub mod anthropic;
pub mod cohere;
pub mod deepseek;
pub mod gemini;
pub mod hyperbolic;
pub mod openai;
pub mod perplexity;
pub mod xai;