Hi, I’m new to pipedream and I ran into some truble. I was following the written tutorial of Thomas Frank’s “How I Use AI to take perfect notes…without typing” video and everything was running smoothly until the " Format the Title, Summary, and Lists" of the tutorial when the program keeps telling me “steps.openai_chat.$return_value is not iterable” every time i test the step, i will put also some links and images. Please help
This is an odd one.
I can’t see your screenshot (it seems to be broken), but in my experience, that variable is always an array:
Which means you shouldn’t get a “not iterable” error.
Can you take a look at the output of your chat step and let us know if you don’t see the [1] next to $return_value?
There i don’t see the circular return warning and i have a 9 instead of a 1.
This is the code from the openai_chat (i hope you can see the screenshot)
Ah, I think I see the issue.
You’re using the format_chat step from the code-heavy version of the tutorial, but you’re using the no-code OpenAI → Chat action.
The no-code action’s steps.openai_chat.$return_value is an object, not an array. That’s why you’re having trouble.
The format_chat step expects an array from the previous step, because that’s what my code for the previous step in the code-heavy version returns.
So you just need to swap out that no-code action for a code step, as described in the article: How to Transcribe Speech to Text with ChatGPT and Notion
When you do that, your return value will be an array.
Oh I see, thanks! I think it’s all good now