@tanstack/ai 0.52.0 → 0.52.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -521,23 +521,26 @@ const { jobId } = await generateVideo({
521
521
  // (x-goog-api-key header or ?key= query parameter).
522
522
  ```
523
523
 
524
- Gemini Omni Flash (`geminiVideo('gemini-omni-flash-preview')`) is served by
524
+ Gemini Omni Flash (`geminiVideo('gemini-omni-1.1-flash')`) is served by
525
525
  the Interactions API instead of Veo's operations flow — same adapter, routed
526
- by model. Clips are 720p; `duration` is any number of seconds in the 3–10
526
+ by model. `duration` is any number of seconds in the 3–10
527
527
  range (fractional ok, default 10 — availableDurations() reports the range),
528
- `size` is the aspect ratio (`'16:9' | '9:16'`), and the finished video arrives
528
+ `size` is an `aspectRatio_resolution` template (`'16:9'` or `'16:9_1080p'`;
529
+ suffix `'360p' | '720p' | '1080p' | '4k'`, default 720p), and the finished video arrives
529
530
  **inline** as a `data:video/mp4;base64,…` URL (no key needed to use it).
530
531
  Image/video prompt parts are sent as interaction content blocks, grouped
531
532
  as images, then videos, then text (no
532
533
  `metadata.role` routing); `data` sources go inline, `url` sources pass
533
534
  through as-is (never downloaded — use Gemini Files API URIs for remote
534
535
  media). For conversational editing, pass a prior generation's `jobId` as
535
- `modelOptions.previous_interaction_id` with a prompt describing the change:
536
+ `modelOptions.previous_interaction_id` with a prompt describing the change.
537
+ `gemini-omni-flash-preview` remains a deprecated alias until it shuts down
538
+ on 2026-09-30.
536
539
 
537
540
  ```typescript
538
541
  import { geminiVideo } from '@tanstack/ai-gemini'
539
542
 
540
- const omni = geminiVideo('gemini-omni-flash-preview')
543
+ const omni = geminiVideo('gemini-omni-1.1-flash')
541
544
  const first = await generateVideo({
542
545
  adapter: omni,
543
546
  prompt: 'A violinist outdoors',
@@ -623,12 +623,12 @@ export function createChatOptions<
623
623
  TStream,
624
624
  InferredContext<TTools, TMiddleware>
625
625
  >,
626
- 'tools' | 'middleware' | 'interrupts'
626
+ 'tools' | 'middleware' | 'interrupts' | 'context'
627
627
  > & {
628
628
  tools?: TTools
629
629
  interrupts?: TInterrupts
630
630
  middleware?: ExactMiddlewareOption<TTools, TContext, TInterrupts, TMiddleware>
631
- } {
631
+ } & RuntimeContextOption<TTools, TMiddleware, TContext> {
632
632
  return options
633
633
  }
634
634
 
@@ -1357,6 +1357,12 @@ export class StreamProcessor {
1357
1357
  state.hasToolCallsSinceTextStart = false
1358
1358
  }
1359
1359
 
1360
+ // A segment begins at its first delta, not its second. Left set, the flag
1361
+ // makes the second delta look like a further segment: the accumulation
1362
+ // resets and updateTextPart writes over the part the first delta created.
1363
+ // A later tool call sets it again in handleToolCallStartEvent.
1364
+ state.hasToolCallsSinceTextStart = false
1365
+
1360
1366
  const currentText = state.currentSegmentText
1361
1367
  const delta = chunk.delta || ''
1362
1368
  const nextText = delta !== '' ? currentText + delta : currentText