TomFrankly / pipedream-notion-voice-notes

Take notes with your voice and send them to Notion
94 stars 49 forks source link

An error occured while attempting to split the file into chunks, or while sending the chunks to OpenAI. #47

Closed mayorgergich closed 7 months ago

mayorgergich commented 7 months ago

    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Object.run (file:///tmp/__pdg__/dist/code/da0675b74e78f05c34811117c0816207386b9ed914b78651fd4d747c1602227f/code/Notion-Voice-Notes.mjs:1943:22)
    at null.executeComponent (/var/task/launch_worker.js:267:22)
    at MessagePort.messageHandler (/var/task/launch_worker.js:764:28)```

I've ensured that my billing is up to date and added credits to the OpenAI account. I'm using a Business G Drive account and no errors during those steps.
TomFrankly commented 7 months ago

@mayorgergich Did your error message also have a "Full error from OpenAI" line on it? It should have, so if you can share that, it'll be helpful!

mayorgergich commented 7 months ago

Hi @TomFrankly ! Here is everything from the pipedream page. Unfortunately I don't see the referenced line anywhere.

Screenshot 2023-11-25 at 5 00 19 PM Screenshot 2023-11-25 at 5 00 12 PM
TomFrankly commented 7 months ago

@mayorgergich thanks for that detail! I think is a generic APIConnectionError from OpenAI, which means it doesn't get a status code but generally means the script was unable to connect to the OpenAI API. This is likely due to factors beyond our control – e.g. issues at OpenAI, or with AWS Lambda (what Pipedream workflows run on).

However, I've gone in and improved the code so that it'll now retry a few times if it hits this generic error. Previously, it would look for a status code before retrying, as I didn't know OpenAI's API had an error type that lacked a status code.

You can update your workflow like so: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

Hopefully this at least reduces the rate of errors like this, since the script will now retry automatically if it hits one!