Skip to content

Map forced tool choice onto the Groq API - #2

Merged
MarcelloDuarte merged 1 commit into
mainfrom
tool-choice
Jul 29, 2026
Merged

Map forced tool choice onto the Groq API#2
MarcelloDuarte merged 1 commit into
mainfrom
tool-choice

Conversation

@MarcelloDuarte

Copy link
Copy Markdown
Contributor

Groq never received the v0.13 toolChoice work, so until now it accepted the option and silently dropped it: the caller's guarantee was quietly broken rather than honoured or refused.

Groq's API is OpenAI-compatible, documented as accepting none, auto, required and {"type":"function","function":{"name":...}}, so this is the same mapping as deepseek and openai. Validation stays in core's ToolChoice::fromOption() and throws before any HTTP call.

7 new tests. composer ci green locally.

Groq was left out of the v0.13 toolChoice release, so it accepted the option
and silently dropped it. Its API is OpenAI-compatible, so the mapping matches
the six providers already shipped: auto, none, required, or the function form
for a named tool.

Validation stays in core and throws before any HTTP call.
@MarcelloDuarte
MarcelloDuarte merged commit 3624236 into main Jul 29, 2026
6 checks passed
@MarcelloDuarte
MarcelloDuarte deleted the tool-choice branch July 29, 2026 22:38
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