mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Refactoring new client
This commit is contained in:
@ -9,7 +9,8 @@ use std::env;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let client = OpenAIClient::new(env::var("OPENAI_API_KEY").unwrap().to_string());
|
||||
let api_key = env::var("OPENAI_API_KEY").unwrap().to_string();
|
||||
let client = OpenAIClient::builder().with_api_key(api_key).build()?;
|
||||
|
||||
let mut tools = HashMap::new();
|
||||
tools.insert("type".to_string(), "code_interpreter".to_string());
|
||||
|
Reference in New Issue
Block a user