supershaneski/openai-whisper-talk

function_return.tool_calls is not iterable

Quantaraum opened this issue · 2 comments

function_return.tool_calls is not iterable.

[nuxt] [request error] [unhandled] [500] function_return.tool_calls is not iterable 15:48:27 at ./.nuxt/dev/index.mjs:1366:38 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.handler (./node_modules/h3/dist/index.mjs:723:19) at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:798:7) data-response undefined

i tested but cannot reproduce this error. so i just added some code to handle when tool_calls becomes not iterable by checking if it is array or not before proceeding.

yea checking if it is an array before iterating over it should solve it.