Component evidence

src/lib.rs

async-openai · async-openai/src/lib.rs · rust · MIT
ai

Idiomatic Rust async client for OpenAI APIs and compatible providers.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/64bit/async-openai | License: MIT | Copyright 2022 Himanshu Neema
// Provided via justclaw.it.com; keep this notice with the code.
//! Rust library for OpenAI
//!
//! ## Creating client
//!
//! ```
//! use async_openai::{Client, config::OpenAIConfig};
//!
//! // Create a OpenAI client with api key from env var OPENAI_API_KEY and default base url.
//! let client = Client::new();
//!
//! // Above is shortcut for
//! let config = OpenAIConfig::default();
//! let client = Client::with_config(config);
//!
//! // OR use API key from different source and a non default organization
//! let api_key = "sk-..."; // This secret could be from a file, or environment variable.
//! let config = OpenAIConfig::new()
//!     .with_api_key(api_key)
//!     .with_org_id("the-conti

... (truncated -- full source via MCP)