Model tries to call unknown function multi_tool_use.parallel

Hi, testing out an assistant in a playground it tried to call a function called “multi_tool_use.parallel” like:

      "required_action": {
        "type": "submit_tool_outputs",
        "submit_tool_outputs": {
          "tool_calls": [
            {
              "id": "call_0obfNi7th7uJiMp6pHUkkh8Z",
              "type": "function",
              "function": {
                "name": "multi_tool_use.parallel",
                "arguments": "{\n  \"tool_uses\": [...]\n}"
              }
            }
          ]
        }

This seems like it contradicts the documentation that multiple parallel tools should be called as a array of [tool_calls], and I can’t find any documentation on this function. This seems unexpected behavior at least!

7 Likes

Could be an internal tool module setup by OpenAI team @kraemahz

1 Like

perhaps an issue with the library? tried upgrading to the latest version?

1 Like

The call happened while using the playground with an assistant, so this is all on OAI’s side.

1 Like

hey, @kraemahz did you sendup finding what could be causing that ? I want to run multiple function but it seems that I get the multi_tool_use.parallel error

1 Like

@kraemahz got the same output, looks like occuring when the models function calling thinks he needs to run multiple tools, probably something internal yep

1 Like

How did you solve this problem? I got this function too. But I just decal one method in function call.

1 Like

Just debugging a code here and this appeared:

https://platform.openai.com/docs/guides/function-calling

Seams to be related to https://platform.openai.com/docs/guides/function-calling/parallel-function-calling

3 Likes

Welcome to the community @Edwin5 , hope you’ve been able to resolve your issue.

1 Like

Welcome to the community @caiopetrellicominato, hope you’ve been able to resolve your issue.

2 Likes

Hitting this too. Is this by-design and should be supported by host applications?

1 Like

I ran into the same today though in my case the function is named parallel without the leading multi_tool_use. No resolution at the moment.

1 Like

I keep getting the same - it must be a training issue mustn’t it? I’ve been changing the instructions a lot and still getting this issue

1 Like

I’ve also been facing this issue every now and then - in my experience the calls would follow a predictable structure that could be reliably hotfixed. I’m guessing OpenAI will fix this eventually, but in the meantime I built a quick patch for this that’s easy to drop into a project to make the problem go away:

github[dot]com/phdowling/openai_multi_tool_use_parallel_patch

Usage is as follows:
pip install openai_multi_tool_use_parallel_patch

In your code:

import openai_multi_tool_use_parallel_patch  # import applies the patch
import openai

client = openai.AsyncOpenAI(...)  # sync client will be patched too

...

response = await client.chat.completions.create(...)  # no changes to the call signature or response vs vanilla OpenAI client
4 Likes

FYI: Patch uses removeprefix(), added in Python 3.9, but PyPi metadata says it’s compatible w/ 3.8.

AttributeError
'str' object has no attribute 'removeprefix'
2 Likes

Yea all good thanks, just updated the openai package to it’s most recent version and implemented as the doc suggested works fine.

1 Like

@atwoodjw_agh Yeah my bad. It also turns out I published the patch with a typo and it would not have worked anyway - it’s fixed now and I just re-released to PyPI. I also tested with python 3.7, things should work okay now. Unfortunately I cannot actually reproduce with a real OpenAI API call at the moment, but if these glitchy responses still gets generated in the same format, the patch should work.

3 Likes

just ran into this bug as well, fixed it by setting the ToolOutput to “failed, please call functions sequentially”, hopefully this works until OpenAI fixes it internally.

3 Likes

Same, I currently both in the system/description mention that parallel tool use is not supported, and if length of the tool_calls is > 1 similarly I return a function output with this error and retry~

It would be really useful if we could simply enable or disable this feature, since it’s part of the tools listed in the system prompt they should easily be able to only add this multi_tool_use.parallel function if we have some option set to true in the API call itself.

1 Like

Just ran into this error for the first time today as well. So it’s certainly still around.
It basically has the two functions it wants to call inside the multi_tool_use.parallel() function call. Not sure if we should program around it assuming this is how ‘parallel’ will work or consider it a bug …

1 Like