Add headers to client

This commit is contained in:
Dongri Jin
2025-03-05 07:26:04 +09:00
parent 2e6ea3eedd
commit ddeefd256c
26 changed files with 77 additions and 113 deletions

View File

@ -5,7 +5,7 @@ use std::env;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let api_key = env::var("OPENAI_API_KEY").unwrap().to_string();
let client = OpenAIClient::builder().with_api_key(api_key).build()?;
let mut client = OpenAIClient::builder().with_api_key(api_key).build()?;
let req = CompletionRequest::new(
completion::GPT3_TEXT_DAVINCI_003.to_string(),