mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-15 09:42:30 +00:00
on quota exceeded suggest user switch to different LLM provider (#221)
* on quota exceeded suggest user switch to different LLM provider * Improve insufficient quota handling, add more telemetry actions --------- Co-authored-by: Carl-Robert Linnupuu <carlrobertoh@gmail.com>
This commit is contained in:
parent
a45646740e
commit
4c8b8d4e4f
6 changed files with 95 additions and 21 deletions
|
|
@ -200,9 +200,16 @@ public abstract class BaseChatToolWindowTabPanel implements ChatToolWindowTabPan
|
|||
}
|
||||
}));
|
||||
requestHandler.addErrorListener((error, ex) -> {
|
||||
responsePanel.enableActions();
|
||||
responseContainer.displayError(error.getMessage());
|
||||
stopStreaming(responseContainer);
|
||||
try {
|
||||
if ("insufficient_quota".equals(error.getCode())) {
|
||||
responseContainer.displayQuotaExceeded();
|
||||
} else {
|
||||
responseContainer.displayError(error.getMessage());
|
||||
}
|
||||
} finally {
|
||||
responsePanel.enableActions();
|
||||
stopStreaming(responseContainer);
|
||||
}
|
||||
});
|
||||
requestHandler.addSerpResultsListener(
|
||||
serpResults -> serpResultsMapping.put(message.getId(), serpResults.stream()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue