Skip to content

Commit

Permalink
balance error message
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed May 1, 2024
1 parent 74e368d commit 47daf8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/services/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ export default class {
if (error.name !== 'AbortError') {
if (error.status === 401 || error.message.includes('401') || error.message.toLowerCase().includes('apikey')) {
message.setText('You need to enter your API key in the Models tab of <a href="#settings">Settings</a> in order to chat.')
} else if (error.status === 400 && (error.message.includes('credit') || error.message.includes('balance'))) {
message.setText('Sorry, it seems you have run out of credits. Check the balance of your LLM provider account.')
} else if (message.content === '') {
message.setText('Sorry, I could not generate text for that prompt.')
} else {
Expand Down

0 comments on commit 47daf8a

Please sign in to comment.