Patch Changes
-
#570
104c4a7Thanks @threepointone! - Update for the latest@tanstack/aiadapter API and refresh Workers AI model references.- Use the new provider summarize factory functions (
createAnthropicSummarize,createGeminiSummarize,createGrokSummarize,createOpenaiSummarize,createOpenRouterSummarize) instead of the removed*SummarizeAdapterclasses, and give the gatewaycreate*Summarizewrappers explicitAnySummarizeAdapterreturn types so declaration files generate cleanly. - Migrate the Workers AI streaming adapter to the
EventTypeenum and the updatedTextOptionsshape (sampling knobs such astemperature/max_tokensnow flow throughmodelOptions;systemPromptsacceptsSystemPromptobjects). - Align the image, transcription, and TTS adapters with the new
(model, config?)base-adapter constructor signature. - Update default/example Workers AI model references to current models (
@cf/google/gemma-4-26b-a4b-it,@cf/moonshotai/kimi-k2.7-code), replacing deprecated ones.
- Use the new provider summarize factory functions (
-
#572
667873fThanks @threepointone! - Fix broken streamed tool calls in the Workers AI adapter (#523).Some Workers AI models stream a tool call's argument fragments before the function
namearrives. The adapter buffers those fragments while waiting for the name (it must, because TanStack AI'sStreamProcessorreads the tool name only once, fromTOOL_CALL_START), but it previously dropped the buffered prefix and forwarded only the post-name fragment. The result was atool-callmessage part with truncated/emptyarguments(and, in earlier versions, a missingname), so tool dispatch silently failed.The adapter now tracks how many argument characters have been emitted and flushes any buffered fragments via
TOOL_CALL_ARGSas soon asTOOL_CALL_STARTis emitted, guaranteeing the full argument string and the tool name reach the consumer regardless of the order in which the model streamsnameandarguments.