Skip to content

Commit 82c5914

Browse files
committed
Bump version to 1.2.2
1 parent 78b7b36 commit 82c5914

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

examples/chat/create_chat_completion/src/main.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
1818
.messages(vec![
1919
ChatMessage::User {
2020
content: ChatMessageContent::Text("Hello!".to_string()),
21-
name: None,
21+
name: Some("Judy".to_string()),
2222
},
2323
ChatMessage::User {
24-
content: ChatMessageContent::Text("What is the capital of Vietnam?".to_string()),
25-
name: None,
24+
content: ChatMessageContent::Text("What is the capital of Singapore?".to_string()),
25+
name: Some("Judy".to_string()),
2626
},
2727
])
2828
.response_format(ChatCompletionResponseFormat::Text)
@@ -32,5 +32,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
3232

3333
println!("{:#?}", result);
3434

35+
for choice in &result.choices {
36+
if let Some(text) = choice.message.text() {
37+
println!("{}", text);
38+
}
39+
}
40+
3541
Ok(())
3642
}

openai_dive/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_dive"
3-
version = "1.2.1"
3+
version = "1.2.2"
44
edition = "2021"
55
license = "MIT"
66
description = "OpenAI Dive is an unofficial async Rust library that allows you to interact with the OpenAI API."

0 commit comments

Comments
 (0)