Skip to content

Incompatible type of tool_choice #670

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

Open
DesZhang opened this issue May 21, 2025 · 0 comments
Open

Incompatible type of tool_choice #670

DesZhang opened this issue May 21, 2025 · 0 comments

Comments

@DesZhang
Copy link

Which version of LM Studio?
LM Studio 0.3.15

Which operating system?
MacOS M3

What is the bug?
As mentioned in openai doc in https://platform.openai.com/docs/api-reference/chat/create, tool_choice could be 'object', but I got {"error":"Invalid tool_choice type: 'object'. Supported string values: none, auto, required"} when trying to pass object value.

Screenshots

Image

To Reproduce
Steps to reproduce the behavior:

curl http://localhost:1234/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-30b-a3b",
    "messages": [{"role": "user", "content": "John Doe is 30 years old."}],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "UserInfo",
          "description": "Correctly extracted `UserInfo` with all the required parameters with correct types",
          "parameters": {
            "type": "object",
            "properties": {
              "name": {
                "title": "Name",
                "type": "string"
              },
              "age": {
                "title": "Age",
                "type": "integer"
              }
            },
            "required": ["age", "name"],
            "additionalProperties": false
          }
        }
      }
    ],
    "tool_choice": { "type": "function", "function": { "name": "UserInfo" } }
  }'
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

No branches or pull requests

1 participant