Releases: cloudflare/ai
@cloudflare/tanstack-ai@0.1.9
Patch Changes
- #518
4358cc1Thanks @zackarychapple! - Widen@tanstack/aipeer dependency and optional adapter ranges to accept newer 0.x releases (up to but not including 1.0.0). Previously the caret ranges on pre-1.0 versions resolved to a single minor (e.g.^0.8.0only allowed>=0.8.0 <0.9.0), causing unmet-peer warnings when consumers installed@tanstack/ai@0.14.0and matching adapter versions.
workers-ai-provider@3.1.13
Patch Changes
-
#510
dfd2cb4Thanks @Specy! - MapinputTokens.cacheReadandinputTokens.noCachefrom Workers AI'susage.prompt_tokens_details.cached_tokensinstead of always reporting them asundefined. This makes prompt-cache hits visible to consumers that compute pricing or telemetry fromLanguageModelV3Usage(generateText/streamTextresult.usage).cached_tokensis treated ascacheRead;cacheWriteremainsundefinedbecause the OpenAI-style usage shape Workers AI returns does not distinguish cache reads from writes.Closes #509.
workers-ai-provider@3.1.12
Patch Changes
-
#504
e9b2a9aThanks @threepointone! - Forwardreasoning_effortandchat_template_kwargsontobinding.run(model, inputs)'sinputsobject 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: nullis preserved as-is (explicit "disable reasoning" signal). The two fields are also typed directly onWorkersAIChatSettings.Closes #501.
@cloudflare/tanstack-ai@0.1.8
Patch Changes
-
#505
f43f6f0Thanks @threepointone! - Add passthrough forreasoning_effortandchat_template_kwargsincreateWorkersAiChat. Pass them per-call throughmodelOptions: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 theinputslevel as required by Workers AI.A new
WorkersAiTextModelOptionstype is exported from@cloudflare/tanstack-aiand@cloudflare/tanstack-ai/adapters/workers-ai.Closes #503.
workers-ai-provider@3.1.11
Patch Changes
- #494
ed6112aThanks @threepointone! - Emittool-input-endandtool-callevents eagerly when streaming multiple tool calls, instead of deferring all of them to stream close. Previously, all tool calls appeared "in progress" simultaneously becausetool-input-endwas only emitted inflush(). Now each tool call is closed as soon as the next one starts or a null finalization chunk is received, matching the behavior of other AI SDK providers.
workers-ai-provider@3.1.10
Patch Changes
- #480
1c6bdadThanks @threepointone! - Add optionalfetchparameter to credentials mode for request interception and testing. Available when usingaccountId + apiKey(not with bindings). Matches the pattern used by@ai-sdk/openaiand@ai-sdk/anthropic.
workers-ai-provider@3.1.9
Patch Changes
-
#474
dc95a5fThanks @threepointone! - update dependencies -
#461
9131bb4Thanks @threepointone! - Replace tsup with tsdown as the build tool
ai-gateway-provider@3.1.3
Patch Changes
-
#474
dc95a5fThanks @threepointone! - update dependencies -
#461
9131bb4Thanks @threepointone! - Replace tsup with tsdown as the build tool
@cloudflare/tanstack-ai@0.1.7
Patch Changes
-
#474
dc95a5fThanks @threepointone! - update dependencies -
#461
9131bb4Thanks @threepointone! - Replace tsup with tsdown as the build tool
workers-ai-provider@3.1.8
Patch Changes
- #455
e02cdd2Thanks @ferdousbhai! - fix(workers-ai-provider): close reasoning block before tool calls and text