Skip to content

Commit 8ed7d01

Browse files
committed
cr
1 parent ae9c048 commit 8ed7d01

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

crates/chat-cli/src/api_client/clients/streaming_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl StreamingClient {
156156
.as_service_error()
157157
.and_then(|err| err.meta().request_id())
158158
.map(|s| s.to_string());
159-
Err(ApiClientError::ModelOverloadedError(request_id))
159+
Err(ApiClientError::ModelOverloadedError { request_id })
160160
} else {
161161
Err(e.into())
162162
}

crates/chat-cli/src/api_client/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub enum ApiClientError {
7070
#[error(
7171
"The model you've selected is temporarily unavailable. Please use '/model' to select a different model and try again."
7272
)]
73-
ModelOverloadedError(Option<String>),
73+
ModelOverloadedError { request_id: Option<String> },
7474
}
7575

7676
#[cfg(test)]

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,21 @@ impl ChatContext {
873873
skip_printing_tools: true,
874874
});
875875

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+
876891
if let Some(user_input) = self.initial_input.take() {
877892
next_state = Some(ChatState::HandleInput {
878893
input: user_input,
@@ -1079,7 +1094,7 @@ impl ChatContext {
10791094
crate::api_client::ApiClientError::QuotaBreach(msg) => {
10801095
print_err!(msg, err);
10811096
},
1082-
crate::api_client::ApiClientError::ModelOverloadedError(request_id) => {
1097+
crate::api_client::ApiClientError::ModelOverloadedError { request_id } => {
10831098
queue!(
10841099
self.output,
10851100
style::SetAttribute(Attribute::Bold),

0 commit comments

Comments
 (0)