Skip to content

Commit e09ea65

Browse files
author
Dongri Jin
committed
v2.1.0
1 parent 075acf5 commit e09ea65

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openai-api-rs"
3-
version = "2.0.5"
3+
version = "2.1.0"
44
edition = "2021"
55
authors = ["Dongri Jin <[email protected]>"]
66
license = "MIT"

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Check out the [docs.rs](https://docs.rs/openai-api-rs/).
77
Cargo.toml
88
```toml
99
[dependencies]
10-
openai-api-rs = "2.0.5"
10+
openai-api-rs = "2.1.0"
1111
```
1212

1313
## Usage
@@ -33,8 +33,9 @@ let client = Client::new(env::var("OPENAI_API_KEY").unwrap().to_string());
3333
### Create request
3434
```rust
3535
use openai_api_rs::v1::chat_completion::{self, ChatCompletionRequest};
36+
use openai_api_rs::v1::common::GPT4;
3637
let req = ChatCompletionRequest::new(
37-
chat_completion::GPT4.to_string(),
38+
GPT4.to_string(),
3839
vec![chat_completion::ChatCompletionMessage {
3940
role: chat_completion::MessageRole::user,
4041
content: String::from("Hello OpenAI!"),
@@ -52,12 +53,13 @@ println!("{:?}", result.choices[0].text);
5253
```rust
5354
use openai_api_rs::v1::api::Client;
5455
use openai_api_rs::v1::chat_completion::{self, ChatCompletionRequest};
56+
use openai_api_rs::v1::common::GPT4;
5557
use std::env;
5658

5759
fn main() -> Result<(), Box<dyn std::error::Error>> {
5860
let client = Client::new(env::var("OPENAI_API_KEY").unwrap().to_string());
5961
let req = ChatCompletionRequest::new(
60-
chat_completion::GPT4.to_string(),
62+
GPT4.to_string(),
6163
vec![chat_completion::ChatCompletionMessage {
6264
role: chat_completion::MessageRole::user,
6365
content: String::from("What is Bitcoin?"),
@@ -85,6 +87,7 @@ Check out the [full API documentation](https://platform.openai.com/docs/api-refe
8587
- [x] [Fine-tunes](https://platform.openai.com/docs/api-reference/fine-tunes)
8688
- [x] [Moderations](https://platform.openai.com/docs/api-reference/moderations)
8789
- [x] [Function calling](https://platform.openai.com/docs/guides/gpt/function-calling)
90+
- [x] [Assistants](https://platform.openai.com/docs/assistants/overview)
8891

8992
## License
9093
This project is licensed under [MIT license](https://github.com/dongri/openai-api-rs/blob/main/LICENSE).

0 commit comments

Comments
 (0)