File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11use openai_api_rs:: v1:: api:: Client ;
22use 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 ;
44use std:: env;
55
66fn 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?" ) ) ,
Original file line number Diff line number Diff 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
2528pub const GPT3_5_TURBO_1106 : & str = "gpt-3.5-turbo-1106" ;
You can’t perform that action at this time.
0 commit comments