@cloudflare/tanstack-ai@0.2.0
·
1 commit
to main
since this release
Minor Changes
-
#590
fe0d182Thanks @threepointone! - - Add resumable streaming to the Workers AI adapter (coming soon — not
generally available yet while the AI Gateway resume backend rolls out; treat as
experimental): catalog models dispatch through the AI Gateway run path, so
transient mid-stream drops reconnect transparently viacf-aig-run-id.
Configure withresume/onResumeExpired(no-op + warning where no run id is
available, e.g. REST).- Gain the gpt-oss forced tool-call salvage (#560) and non-SSE
graceful-degradation, now shared withworkers-ai-provider. - Bump
@tanstack/aiand the@tanstack/ai-*adapter peers to current versions
(adapts to the multimodalMediaPromptAPI).@ai-sdk/*is intentionally not
bumped.
- Gain the gpt-oss forced tool-call salvage (#560) and non-SSE
-
#594
12fb307Thanks @threepointone! - Retry transient Workers AI failures and normalize errors across every adapter.- Chat: the binding shim now surfaces binding failures as HTTP responses
(e.g. "out of capacity"3040→429, "no such model"5007→400) so the
OpenAI SDK's status-based retry engages and honorsRetry-After. Aborts and
unrecognized errors propagate untouched. Non-OK gateway run-path responses are
returned verbatim instead of being swallowed into an empty completion. - Non-chat adapters (embedding, image, TTS, transcription, summarize) gain a
bounded exponential-backoff retry (the OpenAI SDK isn't in play for these) and
normalize binding / REST / gateway failures into a singleWorkersAiRequestError
carrying the HTTPstatus(and the raw Workers AIcodewhen recognized). The
retry loop honors a serverRetry-Afterheader. Non-OK gateway responses are no
longer swallowed. - Add a
maxRetriesoption to the adapter config: forwarded to the OpenAI SDK on
the chat path, and used by the non-chat retry loop. Defaults to2; set to0
to disable.
- Chat: the binding shim now surfaces binding failures as HTTP responses