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
54
55
56
57
58
//! Model management for listing and retrieving model information.
//!
//! This module provides functionality for interacting with the models API,
//! allowing you to list available models or retrieve detailed information
//! about a specific model.
//!
//! # Key Components
//!
//! - [`Models`]: The main struct for performing model operations.
//! - [`models_request`]: A convenient function for creating model request parameters.
//! - [`ModelsData`]: The response type for listing models.
//! - [`Model`]: The response type for retrieving a specific model's information.
//!
//! # Examples
//!
//! ## Listing Models
//!
//! ```rust,no_run
//! use openai4rs::{OpenAI, models_request};
//! use dotenvy::dotenv;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! dotenv().ok();
//! let client = OpenAI::from_env()?;
//! let models = client.models().list(models_request()).await?;
//!
//! for model in models.data {
//! println!("Model ID: {}", model.id);
//! }
//! Ok(())
//! }
//! ```
//!
//! ## Retrieving a Specific Model
//!
//! ```rust,no_run
//! use openai4rs::{OpenAI, models_request};
//! use dotenvy::dotenv;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! dotenv().ok();
//! let client = OpenAI::from_env()?;
//! let model = client.models().retrieve("gpt-4", models_request()).await?;
//!
//! println!("Model details: {:#?}", model);
//! Ok(())
//! }
//! ```
pub use Models;
pub use models_request;
pub use *;