Skip to content

Commit 869c3c1

Browse files
authored
revise model unavailable msg in both mode (#2262)
1 parent f684f8a commit 869c3c1

File tree

1 file changed

+18
-2
lines changed
  • crates/chat-cli/src/cli/chat

1 file changed

+18
-2
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,15 +776,31 @@ impl ChatSession {
776776
("Amazon Q is having trouble responding right now", eyre!(err), false)
777777
},
778778
ApiClientError::ModelOverloadedError { request_id, .. } => {
779+
let model_instruction = if self.interactive {
780+
"Please use '/model' to select a different model and try again."
781+
} else {
782+
"Please relaunch with '--model <model_id>' to use a different model."
783+
};
784+
779785
let err = format!(
780-
"The model you've selected is temporarily unavailable. Please use '/model' to select a different model and try again.{}\n\n",
786+
"The model you've selected is temporarily unavailable. {}{}\n\n",
787+
model_instruction,
781788
match request_id {
782789
Some(id) => format!("\n Request ID: {}", id),
783790
None => "".to_owned(),
784791
}
785792
);
786793
self.conversation.append_transcript(err.clone());
787-
("Amazon Q is having trouble responding right now", eyre!(err), true)
794+
execute!(
795+
self.stderr,
796+
style::SetAttribute(Attribute::Bold),
797+
style::SetForegroundColor(Color::Red),
798+
style::Print("Amazon Q is having trouble responding right now:\n"),
799+
style::Print(format!(" {}\n", err.clone())),
800+
style::SetAttribute(Attribute::Reset),
801+
style::SetForegroundColor(Color::Reset),
802+
)?;
803+
("Amazon Q is having trouble responding right now", eyre!(err), false)
788804
},
789805
ApiClientError::MonthlyLimitReached { .. } => {
790806
let subscription_status = get_subscription_status(os).await;

0 commit comments

Comments
 (0)