Skip to content

Version Packages - #506

Merged
threepointone merged 2 commits into
mainfrom
changeset-release/main
Apr 23, 2026
Merged

threepointone merged 2 commits into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@cloudflare/[email protected]

Patch Changes

  • #505 f43f6f0 Thanks @threepointone! - Add passthrough for reasoning_effort and chat_template_kwargs in createWorkersAiChat. Pass them per-call through modelOptions:

    const adapter = createWorkersAiChat("@cf/zai-org/glm-4.7-flash", {
      binding: env.AI,
    });
    
    chat({
      adapter,
      messages,
      modelOptions: {
        reasoning_effort: "low",
        chat_template_kwargs: { enable_thinking: false },
      },
    });

    Previously these fields were silently dropped, which could cause reasoning models (GLM-4.7-flash, Kimi K2.5/K2.6, GPT-OSS) to burn the entire output token budget on chain-of-thought with no visible content. They now reach binding.run(model, inputs) at the inputs level as required by Workers AI.

    A new WorkersAiTextModelOptions type is exported from @cloudflare/tanstack-ai and @cloudflare/tanstack-ai/adapters/workers-ai.

    Closes #503.

[email protected]

Patch Changes

  • #504 e9b2a9a Thanks @threepointone! - Forward reasoning_effort and chat_template_kwargs onto binding.run(model, inputs)'s inputs object instead of silently dropping them into the options arg / REST query string. This fixes reasoning models (GLM-4.7-flash, Kimi K2.5/K2.6, GPT-OSS, QwQ) burning the entire output token budget on chain-of-thought with no visible content.

    Both settings-level and per-call usage are supported:

    // Settings-level
    const model = workersai("@cf/zai-org/glm-4.7-flash", {
      reasoning_effort: "low",
      chat_template_kwargs: { enable_thinking: false },
    });
    
    // Per-call (overrides settings)
    await generateText({
      model,
      prompt,
      providerOptions: {
        "workers-ai": { reasoning_effort: "low" },
      },
    });

    reasoning_effort: null is preserved as-is (explicit "disable reasoning" signal). The two fields are also typed directly on WorkersAIChatSettings.

    Closes #501.

@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 96df072 to 7a348c8 Compare April 23, 2026 13:07
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 7a348c8 to 4802950 Compare April 23, 2026 13:20
@pkg-pr-new

pkg-pr-new Bot commented Apr 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/cloudflare/ai/ai-gateway-provider@506
npx https://pkg.pr.new/cloudflare/ai/@cloudflare/tanstack-ai@506
npx https://pkg.pr.new/cloudflare/ai/workers-ai-provider@506

commit: 0217a5a

@threepointone
threepointone merged commit 1f97013 into main Apr 23, 2026
3 checks passed
@threepointone
threepointone deleted the changeset-release/main branch April 23, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant