File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ impl StreamingClient {
156
156
. as_service_error ( )
157
157
. and_then ( |err| err. meta ( ) . request_id ( ) )
158
158
. map ( |s| s. to_string ( ) ) ;
159
- Err ( ApiClientError :: ModelOverloadedError ( request_id) )
159
+ Err ( ApiClientError :: ModelOverloadedError { request_id } )
160
160
} else {
161
161
Err ( e. into ( ) )
162
162
}
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ pub enum ApiClientError {
70
70
#[ error(
71
71
"The model you've selected is temporarily unavailable. Please use '/model' to select a different model and try again."
72
72
) ]
73
- ModelOverloadedError ( Option < String > ) ,
73
+ ModelOverloadedError { request_id : Option < String > } ,
74
74
}
75
75
76
76
#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -873,6 +873,21 @@ impl ChatContext {
873
873
skip_printing_tools : true ,
874
874
} ) ;
875
875
876
+ if self . interactive {
877
+ if let Some ( ref id) = self . conversation_state . current_model_id {
878
+ if let Some ( model_option) = MODEL_OPTIONS . iter ( ) . find ( |option| option. model_id == * id) {
879
+ execute ! (
880
+ self . output,
881
+ style:: SetForegroundColor ( Color :: Cyan ) ,
882
+ style:: Print ( format!( "🤖 You are chatting with {}\n " , model_option. name) ) ,
883
+ style:: SetForegroundColor ( Color :: Reset ) ,
884
+ style:: Print ( "\n " )
885
+ )
886
+ . expect ( "Failed to write model information to terminal" ) ;
887
+ }
888
+ }
889
+ }
890
+
876
891
if let Some ( user_input) = self . initial_input . take ( ) {
877
892
next_state = Some ( ChatState :: HandleInput {
878
893
input : user_input,
@@ -1079,7 +1094,7 @@ impl ChatContext {
1079
1094
crate :: api_client:: ApiClientError :: QuotaBreach ( msg) => {
1080
1095
print_err ! ( msg, err) ;
1081
1096
} ,
1082
- crate :: api_client:: ApiClientError :: ModelOverloadedError ( request_id) => {
1097
+ crate :: api_client:: ApiClientError :: ModelOverloadedError { request_id } => {
1083
1098
queue ! (
1084
1099
self . output,
1085
1100
style:: SetAttribute ( Attribute :: Bold ) ,
You can’t perform that action at this time.
0 commit comments