Skip to content

Commit 6487246

Browse files
authored
Merge pull request dongri#98 from dongri/gpt-4o-mini
Add gpt-4o mini model
2 parents 580ffd0 + 151a770 commit 6487246

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/chat_completion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use openai_api_rs::v1::api::OpenAIClient;
22
use openai_api_rs::v1::chat_completion::{self, ChatCompletionRequest};
3-
use openai_api_rs::v1::common::GPT4_O;
3+
use openai_api_rs::v1::common::GPT4_O_MINI;
44
use std::env;
55

66
#[tokio::main]
77
async fn main() -> Result<(), Box<dyn std::error::Error>> {
88
let client = OpenAIClient::new(env::var("OPENAI_API_KEY").unwrap().to_string());
99

1010
let req = ChatCompletionRequest::new(
11-
GPT4_O.to_string(),
11+
GPT4_O_MINI.to_string(),
1212
vec![chat_completion::ChatCompletionMessage {
1313
role: chat_completion::MessageRole::user,
1414
content: chat_completion::Content::Text(String::from("What is bitcoin?")),

src/v1/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ macro_rules! impl_builder_methods {
2020
}
2121
};
2222
}
23+
24+
// https://platform.openai.com/docs/models/gpt-4o-mini
25+
pub const GPT4_O_MINI: &str = "gpt-4o-mini";
26+
2327
// https://platform.openai.com/docs/models/gpt-4o
2428
pub const GPT4_O: &str = "gpt-4o";
2529
pub const GPT4_O_2024_05_13: &str = "gpt-4o-2024-05-13";

0 commit comments

Comments
 (0)