Skip to content

Conversation

@linusbierhoff
Copy link
Contributor

@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

@drbh
Copy link
Collaborator

drbh commented Nov 21, 2024

closing as #2645 was merged and includes the commits from this PR. Thank you!

@drbh drbh closed this Nov 21, 2024
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.

2 participants