### Simple OpenAI Completion Example Source: https://docs.rs/rig-core/latest/rig_core Demonstrates how to create an OpenAI client, build an agent for a specific model (GPT-5.2), and prompt it for a completion. Requires the OPENAI_API_KEY environment variable to be set. ```rust use rig_core:: client::{CompletionClient, ProviderClient}, completion::Prompt, providers::openai; #[tokio::main] async fn main() -> Result<(), Box> { // Create OpenAI client and agent. // This requires the `OPENAI_API_KEY` environment variable to be set. let openai_client = openai::Client::from_env()?; let agent = openai_client.agent(openai::GPT_5_2).build(); // Prompt the model and print its response let response = agent .prompt("Who are you?") .await?; println!("{response}"); Ok(()) } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.