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

Issue with Argument Order in submitToolOutputs Invocation #3664

Closed
shadyshoha opened this issue Dec 14, 2023 · 1 comment · Fixed by #3665
Closed

Issue with Argument Order in submitToolOutputs Invocation #3664

shadyshoha opened this issue Dec 14, 2023 · 1 comment · Fixed by #3665
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@shadyshoha
Copy link
Contributor

shadyshoha commented Dec 14, 2023

Issue with Argument Order in submitToolOutputs Invocation

Description

There seems to be a discrepancy in the order of arguments passed to the submitToolOutputs function in the invoke method of experimental/openai_assistant/index.js. Specifically, the order of threadId and runId is reversed in the last case of the invoke method.

Expected Behavior

The submitToolOutputs function should receive arguments in the following order:

  1. threadId
  2. runId
  3. body

Actual Behavior

In the last else block of the invoke method, the submitToolOutputs function is called with runId first, followed by threadId, which is inconsistent with the expected argument order.

Relevant Code Snippet

// ... [other code in the invoke method] ...

else {
    // Submitting tool outputs to an existing run, outside the AgentExecutor
    // framework.
    run = await this.client.beta.threads.runs.submitToolOutputs(input.runId, input.threadId, {
        tool_outputs: input.toolOutputs,
    });
}

// ... [rest of the invoke method] ...

Suggested Fix

Swap the positions of input.runId and input.threadId in the problematic call to align with the expected argument order.

Copy link

dosubot bot commented Dec 14, 2023

🤖

Thank you for bringing this to our attention! Your observation about the argument order in the submitToolOutputs function call is spot on. It's great to see your attention to detail and your willingness to suggest a fix.

If you'd like to contribute the suggested fix, creating a pull request with the proposed changes would be a valuable contribution to the langchainjs framework. Your effort to improve the codebase is much appreciated!


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the auto:bug Related to a bug, vulnerability, unexpected error with an existing feature label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant