mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-05-16 11:15:34 +00:00
Make it clear that you.com is free in case people run out of OpenAI credits (#238)
* Make it clear that you.com is free in case people run out of OpenAI credits * Clear quota exceeded flag on new api key, minor refactoring --------- Co-authored-by: Carl-Robert Linnupuu <carlrobertoh@gmail.com>
This commit is contained in:
parent
41b3956bf4
commit
4519b2ade6
7 changed files with 36 additions and 9 deletions
|
|
@ -138,6 +138,9 @@ public abstract class BaseChatToolWindowTabPanel implements ChatToolWindowTabPan
|
|||
if (SettingsState.getInstance().isUseAzureService()) {
|
||||
return AzureCredentialsManager.getInstance().isCredentialSet();
|
||||
}
|
||||
if (SettingsState.getInstance().isUseYouService()) {
|
||||
return true;
|
||||
}
|
||||
return OpenAICredentialsManager.getInstance().isApiKeySet();
|
||||
}
|
||||
|
||||
|
|
@ -203,6 +206,9 @@ public abstract class BaseChatToolWindowTabPanel implements ChatToolWindowTabPan
|
|||
requestHandler.addErrorListener((error, ex) -> {
|
||||
try {
|
||||
if ("insufficient_quota".equals(error.getCode())) {
|
||||
if (SettingsState.getInstance().isUseOpenAIService()) {
|
||||
OpenAISettingsState.getInstance().setOpenAIQuotaExceeded(true);
|
||||
}
|
||||
responseContainer.displayQuotaExceeded();
|
||||
} else {
|
||||
responseContainer.displayError(error.getMessage());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue