openai-node
openai-node copied to clipboard
fix(accumulateDelta): AssistantStream accumulateDelta toolCall (#771)
- [x] I understand that this repository is auto-generated and my pull request may not be merged
Changes being requested
One solution I see for this problem is to call openai.beta.threads.runs.retrieve. This PR fixes this bug and allows multiple toolCalls to return, so that calls can be listened to in toolCallCreated and toolCallDone, thus avoiding polling retrieve and improving efficiency. In addition, with this modification, users no longer need to manually assemble the arguments string, they only need to use function.arguments in callTool in the toolCallDone callback.
stream.on("toolCallDone",async (toolCall) =>{
console.log(toolCall.function.arguments)
})
Additional context & links
#771
https://community.openai.com/t/how-to-properly-handle-the-function-call-in-assistant-streaming-node-js/687193