Skip to content

feat(ai, adapters): add chat({ toolChoice }) for every adapter - #1696

Merged
AlemTuzlak merged 9 commits into
feat/reasoning-optionfrom
feat/tool-choice
Oct 9, 2026
Merged

AlemTuzlak merged 9 commits into
feat/reasoning-optionfrom
feat/tool-choice

Conversation

@AlemTuzlak

Copy link
Copy Markdown
Contributor

You can now tell the model when to call a tool, with one option for every adapter: chat({ toolChoice }). It takes 'auto', 'none', 'required', or { type: 'tool', name }. Before, you set a provider-specific tool_choice inside modelOptions.

Stacked on #1692 (reasoning). The Claude rule "thinking on → auto" reads the thinking fields that chat({ reasoning }) sets. Merge #1692 first. GitHub then moves this PR to main.

This PR is split out of #1555.

🎯 Changes

  • Core: chat({ toolChoice }), and a per-call toolChoice from middleware onConfig, which applies to the next model call only. A value in modelOptions still wins. Nothing is sent when the request has no tools.
  • Provider adapters: OpenAI and Azure (Responses), the openai-base adapters, Anthropic, Bedrock, Gemini, Grok, Mistral, and OpenRouter send their own tool_choice field.
    • Claude fallback: on models that cannot force a tool (Fable 5.1, Mythos 5.1, Opus 5.5, Sonnet 5.5), or on any Claude with thinking on, a forced choice falls back to auto. Each model's "cannot force" flag is supports.forced_tool_choice: false in its object in model-meta.ts. Bedrock keeps a list of family names, because its generated catalog has no Claude 5.x entries.
    • Bedrock: Converse has no none, so after tool calls it sends the tools with auto.
    • Ollama: it ignores toolChoice.
  • CLI-style adapters (Claude Code, Codex, OpenCode, Grok Build, ACP): each one follows the values it can. For the values it cannot follow, it logs one warning per adapter instance.
  • Not in this PR:
    • Bedrock native JSON-schema structured output for Claude 5.x. That will be a separate PR.
    • The single subagent tool, the harness step limit, prompt caching, and replay.
  • Docs:
    • A new "Choose when the model calls a tool" section in tools/tools.md.
    • "Change the tool choice of a call" in advanced/middleware.md.
    • A "Tool choice" section on the 5 CLI adapter pages and on ollama.md.
    • The Vercel AI SDK migration row now points to top-level toolChoice.
  • Changesets: tool-choice-core (minor for @tanstack/ai and openai-base), tool-choice-adapters, and tool-choice-cli-adapters (patch).

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.
  • Docs: I updated docs/ for this change, or this change is not user-facing.
  • Changeset: I added a changeset (pnpm changeset), or this PR does not change a published package.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Testing

Commands run

  • The full vitest run (--maxWorkers=2), test:types, and test:oxlint in all 20 changed packages. All pass. That includes the adapters on openai-base that only got tests.
  • pnpm test:docs: no broken links. kiira check on the 9 changed pages: 127 snippets pass.
  • tsc on testing/e2e: no errors in the changed files.
  • Not run locally: pnpm test:pr and the E2E suite. CI runs them.

Manual test

  1. Run pnpm --dir packages/ai exec vitest run tests/tool-choice.test.ts.
  2. Run the Anthropic and Bedrock suites. Check these cases:
    • { type: 'tool', name } is sent as tool_choice.
    • Sonnet 5.5, or any Claude with thinking on, gets auto instead.
    • Bedrock sends auto for 'none' after tool calls.

How this PR makes testing easy

  • Unit and wire tests for each adapter.
  • A new E2E spec tool-choice.spec.ts, with route api.tool-choice-wire.ts and fixture fixtures/tool-choice/basic.json. It checks that toolChoice reaches the wire.

Risk / rollback

Low. This is a new optional option, and with no toolChoice set the requests do not change. To undo, revert this PR.

Public API change

Before

chat({ adapter: openaiText('gpt-6.1-sol'), messages, tools, modelOptions: { tool_choice: { type: 'function', name: 'getWeather' } } })

After

chat({ adapter, messages, tools, toolChoice: { type: 'tool', name: 'getWeather' } })
chat({ adapter, messages, tools, toolChoice: 'required' })

OpenAI-compatible adapters, Anthropic, Bedrock, Gemini, Grok, Mistral, and OpenRouter send toolChoice on the wire. A tool choice in modelOptions wins. Claude models that reject a forced tool, and Claude with thinking on, get auto. Bedrock Converse sends the tools with auto for none after a tool call.
Claude Code, Codex, OpenCode, Grok Build, and ACP bridge only the chat() tools that toolChoice allows: none for 'none', and only the named tool for a named choice. Claude Code also turns its built-in tools off for those values. A value that the agent cannot follow logs one warning for each adapter instance.
OpenAI runs the tool-choice feature through /api/chat and reads tool_choice from the aimock journal. Anthropic uses /api/tool-choice-wire, which captures the request: claude-sonnet-4-5 gets the named tool, and claude-opus-5-5 gets auto.
Add Choose when the model calls a tool to the tools guide, Change the tool choice of a call to the middleware guide, a Tool choice section to the Claude Code, Codex, OpenCode, Grok Build, ACP-compatible, and Ollama pages, and fix the toolChoice row of the Vercel AI SDK migration.
@changeset-bot

changeset-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6878870

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 51 packages
Name Type
@tanstack/ai-anthropic Patch
@tanstack/ai-bedrock Patch
@tanstack/ai-gemini Patch
@tanstack/ai-grok Patch
@tanstack/ai-mistral Patch
@tanstack/ai-openai Patch
@tanstack/ai-openrouter Patch
@tanstack/ai-acp Patch
@tanstack/ai-claude-code Patch
@tanstack/ai-codex Patch
@tanstack/ai-grok-build Patch
@tanstack/ai-opencode Patch
@tanstack/ai Minor
@tanstack/openai-base Minor
@tanstack/ai-code-mode-snippets Patch
@tanstack/ai-angular Patch
@tanstack/ai-byteplus Patch
@tanstack/ai-client Patch
@tanstack/ai-cloudflare Patch
@tanstack/ai-code-mode Patch
@tanstack/ai-cohere Patch
@tanstack/ai-compaction Patch
@tanstack/ai-devtools-core Patch
@tanstack/ai-durable-stream Patch
@tanstack/ai-elevenlabs Patch
@tanstack/ai-fal Patch
@tanstack/ai-groq Patch
@tanstack/ai-llmgateway Patch
@tanstack/ai-lovable Patch
@tanstack/ai-mcp Patch
@tanstack/ai-memory Patch
@tanstack/ai-octane Patch
@tanstack/ai-ollama Patch
@tanstack/ai-ollaya Patch
@tanstack/ai-perplexity Patch
@tanstack/ai-persistence Patch
@tanstack/ai-preact Patch
@tanstack/ai-react Patch
@tanstack/ai-reactor Patch
@tanstack/ai-remix Patch
@tanstack/ai-sandbox-cloudflare Patch
@tanstack/ai-sandbox Patch
@tanstack/ai-skills Patch
@tanstack/ai-solid Patch
@tanstack/ai-svelte Patch
@tanstack/ai-typesafe Patch
@tanstack/ai-vercel-gateway Patch
@tanstack/ai-vertex Patch
@tanstack/ai-vue Patch
@tanstack/ai-worldlabs Patch
ag-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: TanStack/ai/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b66caa10-c8bd-4ff7-850b-fd40a1027726

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit e332c06

Command Status Duration Result
nx run-many --targets=build --exclude=examples/... ✅ Succeeded 3s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-09 17:10:28 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/ai

npm i https://pkg.pr.new/@tanstack/ai@1696

@tanstack/ai-acp

npm i https://pkg.pr.new/@tanstack/ai-acp@1696

@tanstack/ai-angular

npm i https://pkg.pr.new/@tanstack/ai-angular@1696

@tanstack/ai-anthropic

npm i https://pkg.pr.new/@tanstack/ai-anthropic@1696

@tanstack/ai-bedrock

npm i https://pkg.pr.new/@tanstack/ai-bedrock@1696

@tanstack/ai-byteplus

npm i https://pkg.pr.new/@tanstack/ai-byteplus@1696

@tanstack/ai-claude-code

npm i https://pkg.pr.new/@tanstack/ai-claude-code@1696

@tanstack/ai-client

npm i https://pkg.pr.new/@tanstack/ai-client@1696

@tanstack/ai-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-cloudflare@1696

@tanstack/ai-code-mode

npm i https://pkg.pr.new/@tanstack/ai-code-mode@1696

@tanstack/ai-code-mode-snippets

npm i https://pkg.pr.new/@tanstack/ai-code-mode-snippets@1696

@tanstack/ai-codex

npm i https://pkg.pr.new/@tanstack/ai-codex@1696

@tanstack/ai-cohere

npm i https://pkg.pr.new/@tanstack/ai-cohere@1696

@tanstack/ai-compaction

npm i https://pkg.pr.new/@tanstack/ai-compaction@1696

@tanstack/ai-devtools-core

npm i https://pkg.pr.new/@tanstack/ai-devtools-core@1696

@tanstack/ai-durable-stream

npm i https://pkg.pr.new/@tanstack/ai-durable-stream@1696

@tanstack/ai-elevenlabs

npm i https://pkg.pr.new/@tanstack/ai-elevenlabs@1696

@tanstack/ai-event-client

npm i https://pkg.pr.new/@tanstack/ai-event-client@1696

@tanstack/ai-fal

npm i https://pkg.pr.new/@tanstack/ai-fal@1696

@tanstack/ai-gemini

npm i https://pkg.pr.new/@tanstack/ai-gemini@1696

@tanstack/ai-grok

npm i https://pkg.pr.new/@tanstack/ai-grok@1696

@tanstack/ai-grok-build

npm i https://pkg.pr.new/@tanstack/ai-grok-build@1696

@tanstack/ai-groq

npm i https://pkg.pr.new/@tanstack/ai-groq@1696

@tanstack/ai-isolate-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-isolate-cloudflare@1696

@tanstack/ai-isolate-daytona

npm i https://pkg.pr.new/@tanstack/ai-isolate-daytona@1696

@tanstack/ai-isolate-e2b

npm i https://pkg.pr.new/@tanstack/ai-isolate-e2b@1696

@tanstack/ai-isolate-node

npm i https://pkg.pr.new/@tanstack/ai-isolate-node@1696

@tanstack/ai-isolate-quickjs

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs@1696

@tanstack/ai-isolate-quickjs-bun

npm i https://pkg.pr.new/@tanstack/ai-isolate-quickjs-bun@1696

@tanstack/ai-llmgateway

npm i https://pkg.pr.new/@tanstack/ai-llmgateway@1696

@tanstack/ai-lovable

npm i https://pkg.pr.new/@tanstack/ai-lovable@1696

@tanstack/ai-mcp

npm i https://pkg.pr.new/@tanstack/ai-mcp@1696

@tanstack/ai-memory

npm i https://pkg.pr.new/@tanstack/ai-memory@1696

@tanstack/ai-mistral

npm i https://pkg.pr.new/@tanstack/ai-mistral@1696

@tanstack/ai-octane

npm i https://pkg.pr.new/@tanstack/ai-octane@1696

@tanstack/ai-ollama

npm i https://pkg.pr.new/@tanstack/ai-ollama@1696

@tanstack/ai-ollaya

npm i https://pkg.pr.new/@tanstack/ai-ollaya@1696

@tanstack/ai-openai

npm i https://pkg.pr.new/@tanstack/ai-openai@1696

@tanstack/ai-opencode

npm i https://pkg.pr.new/@tanstack/ai-opencode@1696

@tanstack/ai-openrouter

npm i https://pkg.pr.new/@tanstack/ai-openrouter@1696

@tanstack/ai-perplexity

npm i https://pkg.pr.new/@tanstack/ai-perplexity@1696

@tanstack/ai-persistence

npm i https://pkg.pr.new/@tanstack/ai-persistence@1696

@tanstack/ai-preact

npm i https://pkg.pr.new/@tanstack/ai-preact@1696

@tanstack/ai-react

npm i https://pkg.pr.new/@tanstack/ai-react@1696

@tanstack/ai-react-ui

npm i https://pkg.pr.new/@tanstack/ai-react-ui@1696

@tanstack/ai-reactor

npm i https://pkg.pr.new/@tanstack/ai-reactor@1696

@tanstack/ai-remix

npm i https://pkg.pr.new/@tanstack/ai-remix@1696

@tanstack/ai-sandbox

npm i https://pkg.pr.new/@tanstack/ai-sandbox@1696

@tanstack/ai-sandbox-blaxel

npm i https://pkg.pr.new/@tanstack/ai-sandbox-blaxel@1696

@tanstack/ai-sandbox-boxd

npm i https://pkg.pr.new/@tanstack/ai-sandbox-boxd@1696

@tanstack/ai-sandbox-cloudflare

npm i https://pkg.pr.new/@tanstack/ai-sandbox-cloudflare@1696

@tanstack/ai-sandbox-daytona

npm i https://pkg.pr.new/@tanstack/ai-sandbox-daytona@1696

@tanstack/ai-sandbox-docker

npm i https://pkg.pr.new/@tanstack/ai-sandbox-docker@1696

@tanstack/ai-sandbox-e2b

npm i https://pkg.pr.new/@tanstack/ai-sandbox-e2b@1696

@tanstack/ai-sandbox-local-process

npm i https://pkg.pr.new/@tanstack/ai-sandbox-local-process@1696

@tanstack/ai-sandbox-railway

npm i https://pkg.pr.new/@tanstack/ai-sandbox-railway@1696

@tanstack/ai-sandbox-sprites

npm i https://pkg.pr.new/@tanstack/ai-sandbox-sprites@1696

@tanstack/ai-sandbox-upstash-box

npm i https://pkg.pr.new/@tanstack/ai-sandbox-upstash-box@1696

@tanstack/ai-sandbox-vercel

npm i https://pkg.pr.new/@tanstack/ai-sandbox-vercel@1696

@tanstack/ai-skills

npm i https://pkg.pr.new/@tanstack/ai-skills@1696

@tanstack/ai-solid

npm i https://pkg.pr.new/@tanstack/ai-solid@1696

@tanstack/ai-solid-ui

npm i https://pkg.pr.new/@tanstack/ai-solid-ui@1696

@tanstack/ai-svelte

npm i https://pkg.pr.new/@tanstack/ai-svelte@1696

@tanstack/ai-typesafe

npm i https://pkg.pr.new/@tanstack/ai-typesafe@1696

@tanstack/ai-utils

npm i https://pkg.pr.new/@tanstack/ai-utils@1696

@tanstack/ai-vercel-gateway

npm i https://pkg.pr.new/@tanstack/ai-vercel-gateway@1696

@tanstack/ai-vertex

npm i https://pkg.pr.new/@tanstack/ai-vertex@1696

@tanstack/ai-vue

npm i https://pkg.pr.new/@tanstack/ai-vue@1696

@tanstack/ai-vue-ui

npm i https://pkg.pr.new/@tanstack/ai-vue-ui@1696

@tanstack/ai-worldlabs

npm i https://pkg.pr.new/@tanstack/ai-worldlabs@1696

@tanstack/openai-base

npm i https://pkg.pr.new/@tanstack/openai-base@1696

@tanstack/preact-ai-devtools

npm i https://pkg.pr.new/@tanstack/preact-ai-devtools@1696

@tanstack/react-ai-devtools

npm i https://pkg.pr.new/@tanstack/react-ai-devtools@1696

@tanstack/solid-ai-devtools

npm i https://pkg.pr.new/@tanstack/solid-ai-devtools@1696

@tanstack/svelte-ai-devtools

npm i https://pkg.pr.new/@tanstack/svelte-ai-devtools@1696

commit: 6878870

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

✅ Coverage held across 66 compared package(s).

Each package is measured twice in this job — on this PR and on its merge-base with main — and compared. A metric fails only when it is at or above 60% on the merge-base and under 60% on this PR. Other drops are listed but do not fail. Packages your PR doesn't affect are not measured and not listed.

package statements branches functions lines
ai 90.78% (0.00) 83.39% (+0.02) 91.53% (0.00) 92.46% (+0.01) ok
ai-acp 78.41% (+1.11) 66.79% (+2.02) 70.27% (+1.10) 80.13% (+1.01) ok
ai-angular 73.37% (0.00) 60.66% (0.00) 62.14% (0.00) 75.13% (0.00) ok
ai-anthropic 90.66% (+0.19) 83.98% (+0.57) 94.68% (+0.18) 90.88% (+0.15) ok
ai-bedrock 87.00% (+0.98) 79.19% (+0.98) 88.99% (+2.20) 87.91% (+1.01) ok
ai-byteplus 97.02% (0.00) 91.50% (0.00) 98.26% (0.00) 98.47% (0.00) ok
ai-claude-code 88.86% (+0.30) 76.87% (+0.67) 86.88% (+0.44) 90.34% (+0.24) ok
ai-client 86.46% (0.00) 79.22% (0.00) 84.61% (0.00) 88.40% (0.00) ok
ai-cloudflare 84.14% (0.00) 74.73% (0.00) 83.92% (0.00) 85.53% (0.00) ok
ai-code-mode 91.71% (0.00) 83.12% (0.00) 86.27% (0.00) 92.63% (0.00) ok
ai-code-mode-snippets 87.13% (0.00) 75.67% (0.00) 91.11% (0.00) 88.39% (0.00) ok
ai-codex 94.49% (+0.24) 85.10% (+0.60) 89.28% (+0.40) 95.50% (+0.15) ok
ai-cohere 88.97% (0.00) 88.37% (0.00) 85.71% (0.00) 91.80% (0.00) ok
ai-compaction 95.70% (0.00) 82.35% (0.00) 100.00% (0.00) 97.88% (0.00) ok
ai-devtools 83.13% (0.00) 72.77% (0.00) 87.07% (0.00) 85.22% (0.00) ok
ai-durable-stream 86.70% (0.00) 82.25% (0.00) 92.30% (0.00) 88.72% (0.00) ok
ai-elevenlabs 74.68% (0.00) 69.59% (0.00) 59.13% (0.00) 75.46% (0.00) ok
ai-fal 91.10% (0.00) 82.63% (0.00) 92.40% (0.00) 91.60% (0.00) ok
ai-gemini 66.02% (+0.17) 64.92% (+0.27) 61.71% (+0.30) 66.75% (+0.12) ok
ai-grok 48.62% (+0.31) 53.33% (+0.89) 56.16% (0.00) 49.44% (+0.32) ok
ai-grok-build 79.19% (+1.49) 63.56% (+1.78) 77.39% (+1.29) 81.02% (+1.60) ok
ai-groq 50.66% (0.00) 47.17% (0.00) 65.11% (0.00) 52.77% (0.00) ok
ai-isolate-cloudflare 94.11% (0.00) 70.66% (0.00) 100.00% (0.00) 93.96% (0.00) ok
ai-isolate-daytona 90.25% (0.00) 80.59% (0.00) 100.00% (0.00) 90.15% (0.00) ok
ai-isolate-e2b 92.11% (0.00) 81.48% (0.00) 97.36% (0.00) 95.05% (0.00) ok
ai-isolate-node 84.00% (0.00) 43.39% (0.00) 100.00% (0.00) 83.78% (0.00) ok
ai-isolate-quickjs 89.07% (0.00) 76.41% (0.00) 90.90% (0.00) 90.30% (0.00) ok
ai-isolate-quickjs-bun 7.76% (0.00) 8.08% (0.00) 5.00% (0.00) 8.33% (0.00) ok
ai-llmgateway 97.22% (0.00) 100.00% (0.00) 88.88% (0.00) 97.22% (0.00) ok
ai-lovable 72.67% (0.00) 55.63% (0.00) 85.07% (0.00) 73.41% (0.00) ok
ai-mcp 96.52% (0.00) 91.68% (0.00) 96.88% (0.00) 98.48% (0.00) ok
ai-memory 73.87% (0.00) 52.70% (0.00) 79.74% (0.00) 76.04% (0.00) ok
ai-mistral 84.13% (+0.11) 76.49% (+0.88) 93.15% (+0.10) 84.55% (+0.09) ok
ai-octane 90.56% (0.00) 71.48% (0.00) 86.60% (0.00) 90.75% (0.00) ok
ai-ollama 91.34% (0.00) 73.60% (0.00) 90.32% (0.00) 91.31% (0.00) ok
ai-ollaya 86.84% (0.00) 89.28% (0.00) 85.71% (0.00) 91.66% (0.00) ok
ai-openai 63.59% (+0.09) 63.56% (+0.65) 65.48% (+0.51) 64.12% (+0.10) ok
ai-opencode 68.47% (+1.49) 60.77% (+3.35) 64.04% (+1.98) 70.60% (+1.26) ok
ai-openrouter 85.20% (+0.07) 68.20% (+0.24) 89.30% (+0.13) 87.02% (+0.04) ok
ai-perplexity 91.34% (0.00) 90.43% (0.00) 100.00% (0.00) 93.87% (0.00) ok
ai-persistence 90.76% (0.00) 79.80% (0.00) 97.32% (0.00) 94.33% (0.00) ok
ai-preact 87.80% (0.00) 75.87% (0.00) 88.73% (0.00) 89.66% (0.00) ok
ai-react 73.13% (0.00) 52.16% (0.00) 75.54% (0.00) 73.08% (0.00) ok
ai-reactor 94.91% (0.00) 83.33% (0.00) 93.33% (0.00) 96.55% (0.00) ok
ai-remix 39.39% (0.00) 23.35% (0.00) 35.51% (0.00) 41.58% (0.00) ok
ai-sandbox 77.45% (0.00) 82.80% (0.00) 74.47% (0.00) 77.97% (0.00) ok
ai-sandbox-blaxel 87.64% (0.00) 77.18% (0.00) 82.26% (0.00) 89.71% (0.00) ok
ai-sandbox-boxd 95.86% (0.00) 87.12% (0.00) 95.31% (0.00) 98.17% (0.00) ok
ai-sandbox-cloudflare 67.91% (0.00) 57.47% (0.00) 71.79% (0.00) 69.62% (0.00) ok
ai-sandbox-daytona 82.70% (0.00) 81.89% (0.00) 67.14% (0.00) 85.18% (0.00) ok
ai-sandbox-docker 80.15% (0.00) 71.49% (0.00) 77.38% (0.00) 82.13% (0.00) ok
ai-sandbox-e2b 94.42% (0.00) 88.97% (0.00) 93.24% (0.00) 98.63% (0.00) ok
ai-sandbox-local-process 68.00% (0.00) 53.59% (0.00) 75.86% (0.00) 68.88% (0.00) ok
ai-sandbox-railway 94.75% (0.00) 92.68% (0.00) 90.90% (0.00) 97.59% (0.00) ok
ai-sandbox-sprites 73.23% (0.00) 59.70% (0.00) 73.83% (0.00) 76.17% (0.00) ok
ai-sandbox-upstash-box 94.82% (0.00) 91.52% (0.00) 91.04% (0.00) 97.76% (0.00) ok
ai-sandbox-vercel 44.67% (0.00) 38.18% (0.00) 35.18% (0.00) 45.76% (0.00) ok
ai-skills 80.38% (0.00) 64.05% (0.00) 84.86% (0.00) 82.44% (0.00) ok
ai-solid 53.73% (0.00) 40.45% (0.00) 51.94% (0.00) 57.78% (0.00) ok
ai-svelte 70.44% (0.00) 54.50% (0.00) 69.86% (0.00) 75.99% (0.00) ok
ai-typesafe 78.04% (0.00) 84.61% (0.00) 66.66% (0.00) 82.05% (0.00) ok
ai-vercel-gateway 72.90% (0.00) 55.55% (0.00) 85.41% (0.00) 76.52% (0.00) ok
ai-vertex 96.77% (0.00) 97.22% (0.00) 100.00% (0.00) 96.77% (0.00) ok
ai-vue 60.70% (0.00) 36.17% (0.00) 62.00% (0.00) 62.95% (0.00) ok
ai-worldlabs 79.62% (0.00) 71.50% (0.00) 91.42% (0.00) 82.66% (0.00) ok
openai-base 85.82% (+0.07) 71.66% (+0.19) 92.26% (+0.10) 88.04% (+0.05) ok

ToolChoice takes an optional name type. In chat() options, { type: 'tool', name } offers the names of the tools array and still accepts any string, for provider tools and lazy tools.

@jherr jherr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition.

@github-actions github-actions Bot added ready-to-merge Approved, CI green, no conflicts waiting-on: maintainer The ball is in the maintainers’ court labels Oct 9, 2026
@AlemTuzlak
AlemTuzlak merged commit 78c4b83 into feat/reasoning-option Oct 9, 2026
14 checks passed
@AlemTuzlak
AlemTuzlak deleted the feat/tool-choice branch October 9, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Approved, CI green, no conflicts waiting-on: maintainer The ball is in the maintainers’ court

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants