Skip to content

Commit b2e351c

Browse files
authored
Merge pull request #86 from dongri/add-gpt-4o-model
Add GPT4o models
2 parents df82373 + 1a8b5e3 commit b2e351c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/chat_completion.rs

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

66
fn main() -> Result<(), Box<dyn std::error::Error>> {
77
let client = Client::new(env::var("OPENAI_API_KEY").unwrap().to_string());
88

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

src/v1/common.rs

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

2427
// https://platform.openai.com/docs/models/gpt-3-5
2528
pub const GPT3_5_TURBO_1106: &str = "gpt-3.5-turbo-1106";

0 commit comments

Comments
 (0)