TomFrankly / pipedream-notion-voice-notes

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

Moderation Error: Running Default Settings #76

Closed StewartMeusch closed 4 months ago

StewartMeusch commented 4 months ago

Describe the bug

  1. Title really says it all. I get moderation checked even though I'm running no advanced settings. & as described, the defualt shouldn't be running moderation checks?

Which cloud storage app are you using? (Google Drive, Dropbox, or OneDrive)

  1. Dropbox

Have you tried updating your workflow? Please follow the steps here, and ensure you've tested the latest version of the workflow: https://thomasjfrank.com/how-to-transcribe-audio-to-text-with-chatgpt-and-notion/#update

  1. Yes, I'm all up to date

Does the issue only happen while testing the workflow, or does it happen during normal, automated runs?

  1. This has only happened once, and its my first run of the day. The voice note is also 2 hours long, and since trying and failing to run it I've since run out of credits....so I can't try and run it again.

Please paste the contents of your Logs tab from the notion_voice_notes action step.

  1. Error An error occurred while performing a moderation check on the transcript: An error occurred while performing a moderation check on chunk 291. The content of this chunk is as follows: The recession started on 12 of 07. There's 13 months. So look how shallow these are. 47, 43, 16. Error message: Detected inappropriate content in the transcript chunk. Summarization on this file cannot be completed. The content of this chunk is as follows: The recession started on 12 of 07. There's 13 months. So look how shallow these are. 47, 43, 16. Note that you can set Enable Advanced Settings to True, and then set Disable Moderation Check to True, to skip the moderation check. This will speed up the workflow run, but it will also increase the risk of inappropriate content being sent to ChatGPT. Note that you can set Enable Advanced Settings to True, and then set Disable Moderation Check to True, to skip the moderation check. This will speed up the workflow run, but it will also increase the risk of inappropriate content being sent to ChatGPT. Note that you can set Enable Advanced Settings to True, and then set Disable Moderation Check to True, to skip the moderation check. This will speed up the workflow run, but it will also increase the risk of inappropriate content being sent to ChatGPT.

DETAILS at Object.moderationCheck (file:///pipedream/dist/code/1f555395881e5b79fbe9431588e45c7f9763b0394fdc7e0eaabc4ff53300ac5d/code/Notion-Voice-Notes.mjs:726:11) at Object.run (file:///pipedream/dist/code/1f555395881e5b79fbe9431588e45c7f9763b0394fdc7e0eaabc4ff53300ac5d/code/Notion-Voice-Notes.mjs:2039:4) at null.executeComponent (/var/task/launch_worker.js:286:22) at MessagePort.messageHandler (/var/task/launch_worker.js:785:28)

Notion Account: stewart.meusch@gmail.com OpenAI (ChatGPT) Account: OpenAI (ChatGPT) #1 Previous Step Data (Set By Default): { "trigger": { "event": { ".tag": "file", "name": "Top Down Rates and Spreads.m4a", "path_lower": "/notion voice notes/top down rates and spreads.m4a", "path_display": "/Notion Voice Notes/Top Down Rates and Spreads.m4a", "id": "id:mUZRAeHj4BcAAAAAAAAADw", "client_modified": "2024-03-07T14:45:58Z", "server_modified": "2024-03-07T14:45:59Z", "rev": "0161313222e0a87000000012335e5d1", "size": 69497065, "is_downloadable": true, "content_hash": "9e2b21f6fa0d6a968600870382031a9d7a5ad3b6e8b4e9d71bbf844d6487fb54", "link": "https://uc13fa19c281ae23450b0b42b1d0.dl.dropboxusercontent.com/cd/0/get/COqRNaKnlx4xs2MwQp4GKyFbh8puVFuSs_fWY-QtujTg2f5dZSMVA7hqdec0fkUW9JgMOr1e1wpUkUfe6VA_A4vHATcdxYEPhi35vZEUOUBca71RaND_tUcf-5DDQPFrAgRq0nzvh8KxIcy1MoJaFPh78ObkoXxMb0pOA1-neFJOIA/file" }, "context": { "id": "2dMfFRtEmWstCEvjMvZDzrQaWWm", "ts": "2024-03-07T14:46:03.768Z", "pipeline_id": null, "workflow_id": "p_yKCwWAL", "deployment_id": "d_zqsyQ7GM", "source_type": "COMPONENT", "verified": false, "hops": null, "test": false, "replay": false, "owner_id": "o_W7Iqpda", "platform_version": "3.47.6", "workflow_name": "Notion Voice Notes (Dropbox)", "resume": null, "emitter_id": "dc_pJuVvxV", "trace_id": "2dMfFQle6IZg37BxuFGokghmOHL", "attachments": {} } } } Summary Options: [ "Summary", "Main Points", "Action Items", "References", "Follow-up Questions", "Stories", "Arguments", "Related Topics", "Sentiment" ] Notes Database: Current Portfolio (2045cdfd-89ee-4c35-8861-3b1136804a2a) Note Title (Required): Name Note Duration:

Note Cost:

Note Tag:

Note Page Icon: 🤖 ChatGPT Model: gpt-4 Transcript Language (Optional):

Enable Advanced Options: false

Here's the bit from the Logs Tab that shows Moderation check happened....even though it wasn't supposed to? Its just frustrating having to pay for Errors....I've been trying to get this thing up and running for 3 days now and have only gotten 1 Audio file into notion. , 8:49:23 AM Initiating moderation check on the transcript.

TomFrankly commented 4 months ago

@StewartMeusch just pushed an update that fixes this!

If you go into your workflow builder and refresh, you should see the Update button again:

image

This ended up being incredibly simple to fix, but was very tough to track down. In my code, I was checking for whether the Disable Moderation Check setting was "not true" – if that was the case, moderation would be performed.

I figured this would cover things, since I have the default value for that setting set to True.

What I didn't realize is that props that are not visible (e.g. anything hidden by Enable Advanced Props) is actually undefined – their defaults are only set once you enable them. And undefined is technically not true.

Since I didn't know this (it's not documented), every time someone reported this bug, I'd Enable Advanced Props to double-check my setting... thus setting the default value and creating a state different from what the reporter experienced.

Long story short, I changed that check from "not true" to "false" – e.g now the setting must explicitly be false in order for moderation to be performed.