Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Function Arguments in toolCallDone Stream Event Hook #790

Open
1 task done
neilord opened this issue Apr 20, 2024 · 3 comments
Open
1 task done

No Function Arguments in toolCallDone Stream Event Hook #790

neilord opened this issue Apr 20, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@neilord
Copy link

neilord commented Apr 20, 2024

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

The ".on('toolCallDone') used on the stream returned by ai.beta.threads.runs.stream" does not return arguments (empty string), only function name:

{
  index: 0,
  id: 'call_id',
  type: 'function',
  function: { name: 'functionName', arguments: '', output: null }
}

To Reproduce

  1. Retrieve a run stream with ai.beta.threads.runs.stream
  2. Add the .on('toolCallDone') hook.
  3. Wait for the response, it does not return with what arguments should the function be called.

Code snippets

const stream = ai.beta.threads.runs.stream(threadId, {
    assistant_id: assistantId,
});
stream.on('toolCallDone', (toolCall) => {
    console.log(toolCall); // no arguments for function
});

OS

macOS

Node version

v20.11.1

Library version

openai v4.36.0

@neilord neilord added the bug Something isn't working label Apr 20, 2024
@rattrayalex
Copy link
Collaborator

Thanks for reporting, we'll look into it!

@romdotdog
Copy link

Isn't this a duplicate of my issue #771?

@egamma
Copy link

egamma commented May 2, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants