chat_gpt_lib_rs/api_resources/
mod.rs

1//! # API Resources Module
2//!
3//! This module groups together the various API resource modules that correspond to
4//! different OpenAI endpoints, such as models, completions, chat, embeddings, etc.
5//! Each sub-module provides high-level functions and data structures for interacting
6//! with a specific set of endpoints.
7//!
8//! ## Currently Implemented
9//!
10//! - [`models`]: Retrieve and list available models
11//! - [`completions`]: Generate text completions
12//! - [`chat`]: Handle chat-based completions (ChatGPT)
13//! - [`embeddings`]: Obtain vector embeddings for text
14//! - [`moderations`]: Check text for policy violations
15//! - [`fine_tunes`]: Manage fine-tuning jobs
16//! - [`files`]: Upload and manage files
17//!
18//! ## Planned Modules
19//!
20//!
21//! # Example
22//!
23//! ```rust,no_run
24//! use chat_gpt_lib_rs::OpenAIClient;
25//! use chat_gpt_lib_rs::api_resources::models;
26//! use chat_gpt_lib_rs::error::OpenAIError;
27//!
28//! #[tokio::main]
29//! async fn main() -> Result<(), OpenAIError> {
30//!     let client = OpenAIClient::new(None)?;
31//!
32//!     // Example: list and retrieve models
33//!     let model_list = models::list_models(&client).await?;
34//!     let first_model = &model_list[0];
35//!     let model_details = models::retrieve_model(&client, &first_model.id).await?;
36//!     println!("Model details: {:?}", model_details);
37//!
38//!     Ok(())
39//! }
40//! ```
41
42pub mod chat;
43pub mod completions;
44pub mod embeddings;
45pub mod files;
46pub mod fine_tunes;
47pub mod models;
48pub mod moderations;