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

Fix the tool_choice format for named choice by adapting OpenAIs scheme #2634

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

Conversation

linusbierhoff
Copy link

@linusbierhoff linusbierhoff commented Oct 10, 2024

This pull request resolves an issue with the ToolChoice/ToolType struct.
Currently, the API does not allow the OpenAI tool_choice schemes. Currently, the API expects this format to force the usage of an explicit tool:

"tool_choice": {
    "Function": {
         "name": "function_name"
    }
}

(or "tool_choice": “function_name”). Both are incompatible with the OpenAI format.

This pull request changes two things:

  1. Keyword “Function” → “function”
  2. adding the OpenAI schema for named choices:
"tool_choice": {
    "type": "function",
    "function": {
         "name": "function_name"
    }
}

@Narsil

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