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
//! Provider-agnostic completion and chat abstractions.
//!
//! This module contains the low-level request and response types used by provider
//! implementations, plus the high-level traits most callers use through
//! [`Agent`](crate::agent::Agent):
//!
//! - [`Prompt`] sends one user prompt and returns assistant text.
//! - [`Chat`] sends a prompt with existing history and returns assistant text.
//! - [`TypedPrompt`] requests structured output and deserializes it into a Rust type.
//! - [`Completion`] exposes a request builder for call-site overrides.
//! - [`CompletionModel`] is the provider-facing trait implemented by completion models.
//!
//! `CompletionRequest` is Rig's canonical request representation. Provider modules
//! translate it into provider-specific request bodies and convert responses back into
//! [`CompletionResponse`].
//!
//! # Example
//!
//! ```no_run
//! use rig_core::{
//! client::{CompletionClient, ProviderClient},
//! completion::Prompt,
//! providers::openai,
//! };
//!
//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
//! let client = openai::Client::from_env()?;
//! let agent = client
//! .agent(openai::GPT_5_2)
//! .preamble("Answer concisely.")
//! .build();
//!
//! let answer = agent.prompt("What is Rig?").await?;
//! println!("{answer}");
//! # Ok(())
//! # }
//! ```
pub use ;
pub use *;