File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11use openai_api_rs:: v1:: api:: OpenAIClient ;
22use 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 ;
44use std:: env;
55
66#[ tokio:: main]
77async 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?" ) ) ,
Original file line number Diff line number Diff 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
2428pub const GPT4_O : & str = "gpt-4o" ;
2529pub const GPT4_O_2024_05_13 : & str = "gpt-4o-2024-05-13" ;
You can’t perform that action at this time.
0 commit comments