1- use openai_api_rs:: v1:: common:: GPT3_5_TURBO ;
21use tokio:: runtime:: Handle ;
32
3+ use super :: default_model;
4+
45pub struct PromptConfig {
56 pub input : String ,
67 pub model : Option < String > ,
@@ -13,7 +14,7 @@ impl Default for PromptConfig {
1314 fn default ( ) -> Self {
1415 Self {
1516 input : String :: new ( ) ,
16- model : Some ( GPT3_5_TURBO . to_string ( ) ) ,
17+ model : Some ( default_model ( ) . to_string ( ) ) ,
1718 max_tokens : Default :: default ( ) ,
1819 temperature : Default :: default ( ) ,
1920 system_prompt : Default :: default ( ) ,
@@ -28,10 +29,7 @@ async fn _prompt_with_config(config: PromptConfig) -> String {
2829
2930#[ cfg( not( feature = "ai_test" ) ) ]
3031async fn _prompt_with_config ( mut config : PromptConfig ) -> String {
31- use openai_api_rs:: v1:: {
32- chat_completion:: { self , ChatCompletionRequest } ,
33- common:: GPT3_5_TURBO ,
34- } ;
32+ use openai_api_rs:: v1:: chat_completion:: { self , ChatCompletionRequest } ;
3533
3634 let mut client = super :: openai_client ( ) ;
3735
@@ -61,7 +59,7 @@ async fn _prompt_with_config(mut config: PromptConfig) -> String {
6159 config
6260 . model
6361 . take ( )
64- . unwrap_or_else ( || GPT3_5_TURBO . to_string ( ) ) ,
62+ . unwrap_or_else ( || default_model ( ) . to_string ( ) ) ,
6563 messages,
6664 ) ;
6765
0 commit comments