Closed neilord closed 1 week ago
Thanks for reporting, we'll look into it!
Isn't this a duplicate of my issue #771?
Just for completeness. In the toolCallDone
event with the toolCall.type
=== code_interpreter
, then toolCall.code_interpreter.input
is also empty.
As a workaround I'm listening to the event thread.run.step.completed
and handling runStep.step_details.type === 'tool_calls'
then the input
and output
properties are both not empty for function
and code_interpreter
.
Also, aside from this still happening 100% of the times a tool is called, I would also like to add that once the tool output is submitted, the assistant doesn't respond with anything, or at least it is not shown by .on('messageDone') nor with any other .on() listener.
When i have multiple function calls, toolCallDone is called once just with first functionCall.
Is there an bug?
When i have multiple function calls, toolCallDone is called once just with first functionCall.
Is there an bug?
That is correct that toolCallDone
is called once, it is supposed to be the event triggered once AI finished writing the tool call (see docs). The current bug (unless fixed already, probably not) is that toolCallDone
is not usable because when I was testing it, it had the empty function.arguments
parameter.
When i have multiple function calls, toolCallDone is called once just with first functionCall. Is there an bug?
That is correct that
toolCallDone
is called once, it is supposed to be the event triggered once AI finished writing the tool call (see docs). The current bug (unless fixed already, probably not) is thattoolCallDone
is not usable because when I was testing it, it had the emptyfunction.arguments
parameter.
Wich one is called for all tool calls?
Actually im using generic events like:
if (event.event === 'thread.run.requires_action') {
const run = event.data;
run.required_action.submit_tool_outputs.tool_calls.map((toolCall) => {
if (toolCall.type === 'function') {
const assistantResponse = {
id: toolCall.id,
role: 'tool',
type: 'FUNCTION',
content: toolCall.function,
status: 'waiting',
};
this.emit('assistantResponse', assistantResponse);
}
});
this.emit('requiresAction');
}
And submitting all tool calls to my sistems
Closing as a duplicate of https://github.com/openai/openai-node/issues/771
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
The "
.on('toolCallDone')
used on the stream returned byai.beta.threads.runs.stream
" does not return arguments (empty string), only function name:To Reproduce
ai.beta.threads.runs.stream
.on('toolCallDone')
hook.Code snippets
OS
macOS
Node version
v20.11.1
Library version
openai v4.36.0