crybot / obsidian-flashcards-llm

Use Large Language Models (such as ChatGPT) to automatically generate flashcards from obsidian notes
MIT License
33 stars 5 forks source link

Error generating flashcards: Error: Request failed with status code 429 #6

Closed ASOwnerYT closed 6 months ago

ASOwnerYT commented 1 year ago

When I try to generate a flash card, it gives me an error in the top right telling me to check the console. When I check the developer console I see this:

app.js:1 Obsidian Developer Console
plugin:obsidian-tasks-plugin:254 loading plugin "tasks"
plugin:copilot:58432 New chain created:  llm
plugin:copilot:60789 Set chain: llm_chain
plugin:copilot:60758 Setting model to GPT-3.5 16K: gpt-3.5-turbo-16k
plugin:table-editor-obsidian:28663 loading markdown-table-editor plugin
plugin:copilot:60789 Set chain: llm_chain
plugin:copilot:60789 Set chain: llm_chain
VM206 plugin:flashcards-llm:701 Refused to set unsafe header "User-Agent"
setRequestHeader @ VM206 plugin:flashcards-llm:701
api.openai.com/v1/chat/completions:1     Failed to load resource: the server responded with a status of 429 ()
VM206 plugin:flashcards-llm:3680 Error generating flashcards: Error: Request failed with status code 429
    at createError (plugin:flashcards-llm:360:19)
    at settle (plugin:flashcards-llm:376:16)
    at XMLHttpRequest.onloadend (plugin:flashcards-llm:643:11)
onGenerateFlashcards @ VM206 plugin:flashcards-llm:3680
plugin:flashcards-llm:701 Refused to set unsafe header "User-Agent"
setRequestHeader @ plugin:flashcards-llm:701
api.openai.com/v1/chat/completions:1     Failed to load resource: the server responded with a status of 429 ()
plugin:flashcards-llm:3680 Error generating flashcards: Error: Request failed with status code 429
    at createError (plugin:flashcards-llm:360:19)
    at settle (plugin:flashcards-llm:376:16)
    at XMLHttpRequest.onloadend (plugin:flashcards-llm:643:11)
onGenerateFlashcards @ plugin:flashcards-llm:3680
crybot commented 1 year ago

According to openai's documentation, it seems you have hit the default rate limit for the model you're trying to use: https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests

ishmelev23 commented 1 year ago

Also, it's possible if your balance on OpenAI site is empty.