Skip to content

Commit

Permalink
Fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dongri committed Nov 10, 2024
1 parent 78c8fee commit b48f420
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ $ export OPENAI_API_KEY=sk-xxxxxxx

### Create client
```rust
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()?;
```

### Create request
Expand Down Expand Up @@ -57,7 +58,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 req = ChatCompletionRequest::new(
GPT4_O.to_string(),
Expand Down

0 comments on commit b48f420

Please sign in to comment.