Skip to content

Conversation

@DavertMik
Copy link

@DavertMik DavertMik commented Nov 2, 2025

I couldn't make Groq adapter tool choice work with current schema:

Currently it changes:

tool_choice: 'auto' 

to

tool_choice: {}

So I receive this response

 Sending: POST http://api.groq.com:443/openai/v1/chat/completions
D, [2025-11-02T23:32:55.482715 #1278525] DEBUG -- : [httplog] Data: {"model":"openai/gpt-oss-20b","tool_choice":{},

[httplog] Response:
{"error":{"message":"'tool_choice' : value must be a string (auto or none) or an object like `{'type': 'function', 'function': {'name': 'my_function'}}`","type":"invalid_request_error"}}

I tried to pick up the OpenAI definition:

          tool_choice               arguments: :type do 
            type                    Symbol, in: [ :none, :auto, :required ]
            function                arguments: :name do 
              name                  Symbol 
            end 
          end 

But it constructed object which again was not consumed by Groq API

"tool_choice":{"type":"auto"}
{"error":{"message":"'tool_choice' : value must be a string (auto or none) or an object like `{'type': 'function', 'function': {'name': 'my_function'}}`","type":"invalid_request_error"}}

I didn't find a way in dynamic schema to make it Sctring or Object so my proposed fix focuses on basic approaches:

  • tool_choice: auto
  • tool_choice: none

@kristoph I saw you used Kimi K2 f7e8e8c Can you also try it with a tool call (as it is agentic model)?

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