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