I have a loop block using the 'Code' mode to define the loop. inside this I await the call to .trigger(). the loop lambda just calls an openAI API endpoint (uses the REST API resource, not the built-in openAI one).
Interesting find, I am also confused as to why the linter is no longer properly coloring await.
It is good to know that adding parentheses allows the code to run, but I will look into why triggering a REST API resource with .trigger() returns the ... is not a function error message. Is this only happening with an OpenAI REST Resource or has the error message occurred with other APIs?
My hunch is that the polling of the LLM might be a tricky response connection for Retool to handle outside of our built-in OpenAI Resource. But since you got it to work and fully await the query response with await () I could be wrong
Ah ok, yes it looks like you are using the GUI correctly for the lambda function to run on each iteration of the loop block.
That is very interesting that changing the resource from JS code eliminated the "not a function" error.
I can report the parser needing parentheses to our eng team but I can't guarantee they will be able to fix it soon very glad you were able to get it working!
lol no rush at all, await <promise> and await (<promise>) should resolve the same no matter what so if someone uses this syntax or splits it into different lines it'll always resolve the same with or without a fix