mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-23 15:48:07 +00:00
v3.0.1
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "openai-api-rs"
|
name = "openai-api-rs"
|
||||||
version = "3.0.0"
|
version = "3.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Dongri Jin <dongrify@gmail.com>"]
|
authors = ["Dongri Jin <dongrify@gmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
@ -7,7 +7,7 @@ Check out the [docs.rs](https://docs.rs/openai-api-rs/).
|
|||||||
Cargo.toml
|
Cargo.toml
|
||||||
```toml
|
```toml
|
||||||
[dependencies]
|
[dependencies]
|
||||||
openai-api-rs = "3.0.0"
|
openai-api-rs = "3.0.1"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@ -38,7 +38,8 @@ let req = ChatCompletionRequest::new(
|
|||||||
GPT4.to_string(),
|
GPT4.to_string(),
|
||||||
vec![chat_completion::ChatCompletionMessage {
|
vec![chat_completion::ChatCompletionMessage {
|
||||||
role: chat_completion::MessageRole::user,
|
role: chat_completion::MessageRole::user,
|
||||||
content: String::from("Hello OpenAI!"),
|
content: chat_completion::Content::Text(String::from("Hello OpenAI!")),
|
||||||
|
name: None,
|
||||||
}],
|
}],
|
||||||
);
|
);
|
||||||
```
|
```
|
||||||
@ -62,7 +63,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
GPT4.to_string(),
|
GPT4.to_string(),
|
||||||
vec![chat_completion::ChatCompletionMessage {
|
vec![chat_completion::ChatCompletionMessage {
|
||||||
role: chat_completion::MessageRole::user,
|
role: chat_completion::MessageRole::user,
|
||||||
content: String::from("What is Bitcoin?"),
|
content: chat_completion::Content::Text(String::from("What is Bitcoin?")),
|
||||||
name: None,
|
name: None,
|
||||||
}],
|
}],
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user