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

Support parallel function calls with tool_choice #1503

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

CISC
Copy link
Contributor

@CISC CISC commented Jun 2, 2024

Enable the return of parallel function calls when tool_choice is set to a specific function, previously you would only get the following response for get_current_weather and the prompt What's the weather like in Oslo and Stockholm?:

[
    {
        "id": "call__0_get_current_weather_cmpl-...",
        "type": "function",
        "function": {
            "name": "get_current_weather",
            "arguments": "{\"location\": \"Oslo, NO\", \"unit\": \"celsius\"}"
        }
    }
]

Now you will get all the get_current_weather calls:

[
    {
        "id": "call__0_get_current_weather_cmpl-...",
        "type": "function",
        "function": {
            "name": "get_current_weather",
            "arguments": "{\"location\": \"Oslo, NO\", \"unit\": \"celsius\"}"
        }
    },
    {
        "id": "call__1_get_current_weather_cmpl-...",
        "type": "function",
        "function": {
            "name": "get_current_weather",
            "arguments": "{\"location\": \"Stockholm, SE\", \"unit\": \"celsius\"}"
        }
    },
]

Additionally the function call names will now be verified (and filtered if not matching), whereas before there was the possibility of picking up a different function call with similar parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant