Commit 65c917e
feat(ai-gemini): add geminiTextInteractions() adapter for stateful Interactions API (#502)
* feat(ai-gemini): add geminiTextInteractions() adapter for stateful Interactions API
Routes through `client.interactions.create` so callers can pass
`previous_interaction_id` via `modelOptions` and let the server retain
conversation history. Surfaces the server-assigned interaction id on
`RUN_FINISHED.providerMetadata.interactionId` (a new field on the
`RunFinishedEvent`) to feed back on the next turn.
Scope: text output with function tools only; built-in Gemini tools and
non-text output via Interactions remain on `geminiText()`. Marked
`@experimental` — the underlying API is Beta per Google.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* refactor(ai-gemini): surface interactionId via CUSTOM event, drop core providerMetadata field
Replace the `RunFinishedEvent.providerMetadata.interactionId` approach
with an AG-UI `CUSTOM` event (`name: 'gemini.interactionId'`) emitted
just before `RUN_FINISHED`. Keeps the provider-specific identifier
outside the core `@tanstack/ai` type surface — no change to shared
types required. The `CUSTOM` event is the AG-UI protocol's designated
escape hatch for provider-specific data.
Also adds an `asChunk` cast helper (mirroring sibling `text.ts`) to
fix type errors where string-literal event types weren't narrowing
to the `EventType` enum.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): address CodeRabbit review feedback on Interactions adapter
- Send trailing tool results (not just the latest user turn) when chaining via
previous_interaction_id, so function-call round-trips survive statefully.
- Throw a descriptive error if previous_interaction_id is set with no sendable
content instead of silently sending empty input.
- Accumulate function_call arguments across incremental content.delta events
via object-level merge (SDK types args as an object per delta).
- Emit REASONING_START / REASONING_MESSAGE_START / REASONING_MESSAGE_CONTENT /
REASONING_MESSAGE_END / REASONING_END for thought_summary deltas, matching
the pattern in text.ts; keep legacy STEP_STARTED/STEP_FINISHED for transition.
- Return (not break) after RUN_ERROR so no further terminal events leak out.
- Guard JSON.parse on assistant toolCall.arguments with a safe fallback.
- Docs: fix createGeminiTextInteractions config field (baseURL, not
httpOptions) and link Google's Interactions docs for retention policy.
* ci: apply automated fixes
* fix(ai-gemini): emit RUN_ERROR with spec-compliant flat message/code
The Interactions adapter emitted RUN_ERROR with only a nested `error` object,
which stripToSpecMiddleware removes by design — leaving downstream consumers
with no error detail at all. Match the dual-form pattern from text.ts: emit
flat `message`/`code` alongside the nested `error` so both spec-compliant and
legacy consumers get the information.
Update the three affected unit tests to assert against the flat fields.
* feat(examples): wire Gemini Interactions into ts-react-chat, refresh models
Adds a `gemini-interactions` provider in the example's model selector backed
by `geminiTextInteractions`, threads the server-assigned interactionId from
the `gemini.interactionId` CUSTOM event through client state back into
`previous_interaction_id` on subsequent turns, and refreshes MODEL_OPTIONS
across every provider to current defaults (GPT-5.2, Claude 4.6, Gemini 3.1
preview, Grok 4.20, etc.). Also plumbs the standard `InternalLogger`
(request / provider / errors) through `GeminiTextInteractionsAdapter` so
`debug: true` produces useful diagnostics on this adapter like every other
text adapter.
Tools are intentionally omitted for the `gemini-interactions` branch because
the Interactions API rejects `anyOf` in function parameter schemas.
* test(ai-gemini): route adapter tests through public core APIs
Refactor ai-gemini tests to call chat() and generateImage() instead of
invoking adapter methods. This drops the test-only dependency on the
internal InternalLogger and exercises the real activity code paths
end-to-end, matching the pattern already used by the audio/tts/chat
test suites.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(ai-gemini): built-in tools on geminiTextInteractions()
Wires google_search, code_execution, url_context, file_search, and computer_use through the stateful Interactions adapter by translating tool factories into the snake_case Tool_2 union the Interactions SDK expects; surfaces per-tool *_call / *_result deltas as AG-UI CUSTOM events named gemini.googleSearchCall / gemini.googleSearchResult (and matching codeExecution/urlContext/fileSearch variants) so consumers can display provider-tool activity without conflating it with function-tool TOOL_CALL_* events. Rejects google_search_retrieval, google_maps, and mcp_server with targeted errors pointing at the supported alternative.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* ci: apply automated fixes (attempt 2/3)
* refactor(ai-gemini)!: gate `geminiTextInteractions` behind `/experimental` subpath
Move the stateful Interactions adapter sources into `src/experimental/text-interactions/` and expose `geminiTextInteractions`, `createGeminiTextInteractions`, `GeminiTextInteractionsAdapter`, and the related types only via the new `@tanstack/ai-gemini/experimental` subpath. The package root no longer re-exports them, so the experimental status is load-bearing in callers' editors and bundles. Update the ts-react-chat example, unit test, docs, and changeset to import from the new path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(ai-gemini): consolidate `geminiTextInteractions` changesets
Merge `gemini-text-interactions-builtin-tools.md` into `gemini-text-interactions.md` so the published changelog describes the unreleased adapter as a single feature instead of an "added it" / "actually it does support built-ins" flip-flop. Also fixes the markdown corrupted by autofix-ci in the second file.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Marked gemini interactions as experimental in example
* test(e2e): wire up stateful-interactions spec for geminiTextInteractions
Implements the previously-skipped two-turn E2E flow:
- Routes provider=gemini + feature=stateful-interactions through
createGeminiTextInteractions (from @tanstack/ai-gemini/experimental)
in createTextAdapter.
- Surfaces the gemini.interactionId CUSTOM event from useChat into a
hidden data-testid="gemini-interaction-id" element.
- Threads the captured id back via body.previousInteractionId, which
api/chat translates into modelOptions.previous_interaction_id.
- Adds a two-turn fixture under testing/e2e/fixtures/stateful-interactions/
matched by userMessage.
Blocked end-to-end on aimock PR CopilotKit/aimock#139, which currently
parses Turn[] input as turn.parts but the official @google/genai SDK
schema is turn.content. See:
CopilotKit/aimock#139 (comment)
Once that's fixed the spec should pass; all the TanStack-side wiring is
already in place.
* chore(e2e): drop stale "aimock doesn't mock interactions" note
aimock 1.18.0 added Gemini Interactions API support
(CopilotKit/aimock#139), so the spec runs against the live fixture
handler now. Remove the comment that promised skip-until-landed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* feat(ai-gemini): include threadId + parentRunId on Interactions RUN_STARTED
Brings geminiTextInteractions in line with the AG-UI client-to-server
compliance changes from #511. RUN_STARTED now carries threadId and
parentRunId, and RUN_FINISHED carries threadId — matching the
geminiText adapter and the rest of the matrix.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(ai-gemini): export GeminiInteractionsCustomEvent discriminated union
Adds a typed union for every CUSTOM event the geminiTextInteractions
adapter emits — `gemini.interactionId` plus the eight built-in tool
call/result pairs (google_search, code_execution, url_context,
file_search). Tool-delta variants forward the raw
`Interactions.ContentDelta.*Delta` shape from `@google/genai` so
consumers stay in sync with the SDK automatically.
Exported from `@tanstack/ai-gemini/experimental` alongside the
adapter:
```ts
import type { GeminiInteractionsCustomEventValue } from '@tanstack/ai-gemini/experimental'
onCustomEvent: (name, data) => {
if (name === 'gemini.interactionId') {
const value = data as
| GeminiInteractionsCustomEventValue<'gemini.interactionId'>
| undefined
if (value?.interactionId) setInteractionId(value.interactionId)
}
}
```
Updates the ts-react-chat example and the e2e route to use the typed
narrowing instead of inline `as { interactionId?: string }` casts.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): send Interactions input as string | Content[], not Turn[]
Google's Interactions API rejects `Array<Turn>` input with
`invalid_request` / "value at top-level must be a list", even though
@google/genai's SDK type union (`string | Array<Content> | Array<Turn> | ...`)
suggests Turn[] is supported. The published examples only use `string`
or `Array<Content>`, and the live API enforces that.
This was previously masked by aimock 1.24.x accepting both shapes in
the e2e fixture handler.
Adapter now:
- Fresh conversation (no `previous_interaction_id`): only a single
user turn is supported. Send the user text as a plain `string` or
flatten multimodal content to `Array<Content>`. Multi-turn history
on a fresh interaction throws a targeted error directing callers
to chain via `previous_interaction_id`.
- Continuation (`previous_interaction_id` set): flatten the
post-assistant slice (new user text, tool results) into
`Array<Content>`. Collapse a single text block to a plain string
to match the SDK's documented happy-path shape.
Tests updated to assert the new wire shape; net +1 passing case
(108/108).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* fix(ai-gemini): wire useChat into the Interactions API correctly
Two related fixes for the experimental Gemini Interactions adapter,
both surfaced as runtime errors in the ts-react-chat example.
1. "value at top-level must be a list" from the live API
- adapter.ts: always send `input` as `Array<Content>`. The SDK's
type union (`string | Array<Content> | Array<Turn> | ...`)
suggests bare strings are accepted, but the live API rejects them
-- at minimum once `tools` are present -- with `invalid_request`
/ "value at top-level must be a list". `Array<Turn>` is rejected
for the same reason. Removes the `messageToInput` fast-path and
the single-text-block collapse on follow-up turns.
- tests: assertions updated to match the uniform wire shape.
2. "cannot send prior conversation history on a fresh interaction"
when switching model/provider mid-conversation
- examples/ts-react-chat: clear messages alongside interactionId in
the provider/model useEffect. The Interactions API cannot replay
history statelessly, so carrying a buffer from a different
provider or stale interaction ships invalid multi-turn input.
- docs/adapters/gemini.md: new "Wiring with useChat" section with
server-route + React client snippets, plus a Caveat on the
stateless-replay rule and the model-switch buffer reset.
- adapter JSDoc and the multi-turn error message now reference the
docs section so the next user to hit the error lands on the fix.
* fix(ai-gemini): correctly format Interactions API wire requests
Verified directly against the live Interactions API which shapes are
actually accepted; the SDK's TypeScript union and historical comments
in the adapter both turned out to be wrong on multiple counts:
- `input` must be `Array<Step>` (each Step is
`{type:"user_input", content:[...]}` or
`{type:"function_result", call_id, ...}`). Neither bare `Array<Content>`
nor `Array<Turn>` works once tools are present, despite the SDK's
typing. `Array<Step>` is what ai.google.dev/api/interactions-api
documents.
- Tool parameter schemas containing `"required": []` (an EMPTY required
array) trigger the same unhelpful top-level error "value at top-level
must be a list". Empty `properties: {}` and `parameters: {}` are fine,
only `required: []` is the poison. The Zod -> JSON Schema converter
emits this for any tool with no required params (e.g. `z.object({})`),
so the adapter now strips empty `required` arrays recursively before
sending.
Adapter also gains intra-request agent-loop chaining: it remembers the
server-assigned interaction id per threadId so iteration N+1 chains off
iteration N's id automatically. The caller has no opportunity to thread
it back between iterations of the same chat() call. Cross-request
chaining via `modelOptions.previous_interaction_id` is unchanged.
ts-react-chat:
- Re-enable server-side tools for gemini-interactions. The historical
`anyOf` exclusion turned out unnecessary (unions work fine against
the live API) and the empty-required rejection is now sanitized.
- Add gemini-2.5-flash and gemini-2.5-pro to the model selector;
rename gemini-3.1-flash-lite-preview to its GA name
gemini-3.1-flash-lite.
109/109 adapter unit tests passing; regression test for the
required-array sanitizer included.
* fix(ai-gemini): tighten experimental Interactions adapter type safety + lifecycle
Type safety on the geminiTextInteractions() adapter:
- Restore per-model narrowing on GeminiTextInteractionsAdapter via
ResolveProviderOptions/InputModalities/ToolCapabilities, mirroring
GeminiTextAdapter. Passing `document` to a model that doesn't support
it is now a compile error.
- Replace the `asChunk` Record<string, unknown> -> StreamChunk cast
helper with EventType-discriminated typed object literals at every
emission site, so missing/typoed fields fail at compile time.
- Align GeminiInteractionsCustomEvent variants with the project's
StructuredOutputCompleteEvent shape (extends Omit<CustomEvent,
'name'|'value'>) and export a GeminiInteractionsStream analog of
StructuredOutputStream for consumers.
- Introduce GeminiInteractionsRequestBody so the SDK-boundary cast is
confined to one site rather than scattered Parameters<...>[0] casts.
- Drop the redundant ExternalTextInteractionsProviderOptions re-export.
Correctness fixes:
- Inspect interaction.status: failed/cancelled produce RUN_ERROR with
the status as `code`; incomplete maps to finishReason 'length';
requires_action always maps to 'tool_calls'.
- Synthesize RUN_ERROR if the SDK stream ends without a terminal
event; close in-flight TEXT_MESSAGE_START / TOOL_CALL_START /
REASONING_* before any RUN_ERROR so downstream consumers don't see
orphan open state.
- Thread options.abortController.signal into both interactions.create
calls so aborted requests stop burning upstream tokens.
- Evict interactionIdByThread on terminal RUN_FINISHED/RUN_ERROR (and
catch/EOF paths) so the Map can't grow unbounded.
- Mirror the captured-interaction-id fallback in structuredOutput so
agentic-structured flows with tool calls don't throw "cannot send
prior conversation history".
- closeReasoningIfNeeded now resets thinkingStepId/reasoningMessageId
so a later thought_summary delta opens a fresh reasoning block
instead of re-using an ended messageId.
- Throw a clear error on non-string tool-result content instead of
silently coercing arrays/null to ''.
- Preserve the SDK error as `cause` when rewrapping structuredOutput
failures so Sentry dedup sees the real stack/status.
- Log silent JSON parse fallbacks via logger.errors instead of
returning empty objects with no telemetry.
- Distinct error message when structuredOutput receives no text
(model produced only tool calls / non-text), rather than a
misleading "Failed to parse JSON".
- Correct the docs and JSDoc claim about computer_use surfacing
per-delta CUSTOM events — the SDK has no ComputerUseCall/ResultDelta.
Also clears pre-existing TypeScript errors across the example app
(ElevenLabs literal-union casts, unused ctx params, TranscriptionGenerateInput
fetcher signature) and the e2e workspace (Provider/Feature union
additions, CSS module shim, model-to-feature translation in api.audio.stream,
StructuredOutputStream variance casts at toServerSentEventsResponse sites).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* ci: apply automated fixes
* fix(ai-gemini): plug interactionId map leak; verify E2E chains the id
- adapter: hoist `sawTerminalEvent` to function scope and add a `finally`
that evicts the per-threadId interactionId when no terminal event was
observed. Closes the abandonment path (consumer `.return()` on the
generator via upstream break/abort), which previously left a stale id
for the next request on the same threadId.
- e2e: capture every POST to /api/chat and assert turn 2's forwardedProps
carry the id surfaced by turn 1's gemini.interactionId CUSTOM event.
aimock normalises requests to the OpenAI canonical shape and discards
previous_interaction_id, so a response-only assertion would have passed
even if the route silently dropped the id on turn 2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): evict interactionId on abandonment after tool_calls turn
The prior `finally` predicate (`!sawTerminalEvent`) didn't cover `.return()`
abandonment AFTER a `RUN_FINISHED(tool_calls)`: `sawTerminalEvent` is `true`
in that case but the in-loop code intentionally keeps the map entry for the
next agent-loop iteration. If the consumer abandons before that iteration
fires, the entry leaks and the next request on the same threadId silently
chains off a stale id — exactly what the lifecycle comment promises will
not happen.
Track try-block completion via a `completedTryBlock` flag set only at the
bottom of the try, and switch the `finally` guard to `!completedTryBlock`.
This distinguishes consumer abandonment (the only path that fails to reach
end-of-try without throwing) from normal completion, including the
tool_calls continuation case where the entry must be preserved.
Also tightened the field-level lifecycle comment to enumerate every
eviction path (terminal events, truncation, throw, abandonment) instead
of just the two it previously named.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): seal truncated AG-UI events + preserve interactionId across structuredOutput
- Truncation path: the synthetic RUN_ERROR is now preceded by closeOpenState()
so orphan TEXT_MESSAGE_START / TOOL_CALL_START / REASONING_* don't leak to
downstream consumers when the SDK closes without a terminal event.
- Tool-call args are now accumulated as Record<string, unknown> rather than
stringified JSON, eliminating the re-parse-then-merge cycle that could
silently discard prior fragments on a single parse failure.
- InteractionsTool type derived from the SDK's CreateModelInteractionParamsStreaming
directly (no more `any` predicate in Extract).
- interactionId Map eviction moved from end-of-call-on-stop to start-of-call
on fresh-turn intent (single user message + no caller-provided id). This
lets the agentic-structured composition (chatStream → structuredOutput on
the same threadId with multi-turn messages) chain via the captured id,
while a brand-new turn still starts clean.
- 7 new tests pinning each eviction path (tool_calls preservation, RUN_FINISHED(stop),
RUN_ERROR, truncation+seal, .return() abandonment pre/post tool_calls,
agentic-structured chain recovery).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(ai-gemini): correct stale API Reference signatures
- createGeminiChat(model, apiKey, config?) — not (apiKey, config?)
- geminiText(model, config?) — not (config?)
- geminiSummarize(model, config?) and createGeminiSummarize(apiKey, model, config?) —
documented arg lists previously omitted the required model arg.
- Removed phantom createGeminiText (the real factory is createGeminiChat).
- Renamed geminiTTS / createGeminiTTS → geminiSpeech / createGeminiSpeech to
match the actual exports.
- Custom-API-Key example: corrected arg order and replaced GeminiChatConfig
(doesn't exist) with GeminiTextConfig.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(e2e): consistent error handling + harden stateful-interactions spec
- All four route catch blocks now log via console.error, narrow with
`error instanceof Error`, and return 499 on aborted requests. The
audio.stream and summarize handlers previously swallowed errors
silently and assumed `error.message` on `any`.
- stateful-interactions spec: clarified the test boundary in the
doc-comment, tightened the interactionId guard beyond "truthy", and
added cross-turn forwardedProps shape sanity assertions so a regression
that replaces (rather than augments) turn 2's body can't pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore(e2e): bump @copilotkit/aimock to ^1.27.0 for Step[] envelope support
1.27.0 ships PR CopilotKit/aimock#229 (closes #228) which adds top-level
Step[] envelope recognition in the Gemini Interactions handler. Without
this the stateful-interactions E2E spec gets 404 "No fixture matched"
because aimock falls through to the ContentBlock[] branch and extracts
an empty userMessage from `[{type: 'user_input', content: [...]}]`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): align experimental adapter + tests with tightened main
Post-rebase fixups picked up by main's new TS strict flags (#564) and
the structured-output orchestration changes (#600):
- Add explicit `override` modifiers on `GeminiTextInteractionsAdapter`'s
`kind` and `name` fields. Required by TS 5.9 `noImplicitOverride`
flowing through `BaseTextAdapter`.
- Switch `beforeEach` from `clearAllMocks` to `mockReset`. Cross-test
pollution was real: `mockResolvedValue` (permanent return) survives
`clearAllMocks` but not `mockReset`, so a prior test's stream was
leaking into later tests' tail-end calls.
- Drop the now-redundant chatStream-then-structuredOutput composition
in `structuredOutput parses JSON …`. Main's
`runAgenticStructuredOutput` skips the agent loop entirely when no
tools are passed and goes straight to `adapter.structuredOutput`, so
the chat-stream mock was never consumed and the test was eating its
own mock for the structured-output call.
- Rewrite the multi-turn chaining regression to mirror the same flow:
one seed chatStream call captures the id, the composing structured
call must pick it up from the Map.
- Lock down strict-mode types on `mock.calls[N]!` access and avoid the
string-vs-EventType narrowing footgun on `chunks.map(c => c.type)`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(e2e): restore AudioGenUI wiring incidentally dropped by PR #527
PR #527 ("streaming structured output across openai/openrouter/grok/groq
+ summarize fix") silently dropped the AudioGenUI scaffolding from
$feature.tsx — its import, its 'audio-gen'/'sound-effects' entries in
MEDIA_FEATURES, and the corresponding switch cases in MediaFeature. The
removal isn't mentioned anywhere in PR #527's title, body, or any of its
~30 commit messages, and is orthogonal to its stated scope.
The audio-gen scaffolding everywhere else (matrix, types, features,
provider/media-provider factories, fixtures, spec files) is still intact
on main and on this branch. Without the route's UI activation, the spec
files orphan and any test path that exercises them 404s.
Surfaced on this branch because the stateful-interactions work added
matching matrix entries and re-activated the audio-gen test loop. Fixing
in this PR rather than upstream so the branch is green; happy to spin out
a separate fix-PR for main if preferred.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-gemini): clear lint errors in experimental Interactions adapter
CI's eslint job flagged 6 errors on the new adapter:
- `client` and `interactionIdByThread` private members never reassigned —
mark them `readonly` (@typescript-eslint/prefer-readonly).
- structuredOutput's `await this.client.interactions.create(request as
GeminiInteractionsRequestBody & Parameters<…>[0])` had a redundant
`as GeminiInteractionsRequestBody` since `request` is already that
type. Trim to just the SDK-boundary cast
(@typescript-eslint/no-unnecessary-type-assertion).
- convertMessagesToInteractionsInput's `const only = source[0]!` was
unprovable to TS under noUncheckedIndexedAccess. Refactor the two
length checks into a single destructure-and-check on
`[only, ...rest] = source`, which the linter accepts without `!`
(@typescript-eslint/no-non-null-assertion).
- content.delta switch was missing case arms for SDK union members the
adapter intentionally doesn't translate (image/audio/video/document
outputs, response-side function_result, mcp_server_tool_*,
thought_signature). Add explicit fall-through arms so
@typescript-eslint/switch-exhaustiveness-check sees the coverage; the
default still does the logger.provider observability call.
- thought_summary's `reasoningMessageId!` non-null was unprovable
because TS couldn't tie thinkingStepId-null to reasoningMessageId-null.
Widen the guard to check both (`thinkingStepId === null ||
reasoningMessageId === null`) and drop the `!`.
No behavior change. All 140 unit tests still pass, types clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs(ai-gemini): refresh experimental Interactions section to 3.x models
Replace gemini-2.5-pro/-flash/-flash-preview-tts in the Gemini adapter
docs with gemini-3.1-pro-preview / gemini-3.5-flash /
gemini-3.1-flash-tts-preview, all available in the post-rebase model
meta. Switch the basic-usage snippet's interactionId capture to the
exported GeminiInteractionsCustomEventValue helper instead of an inline
ad-hoc cast, matching the React example below. Refresh the example
app's gemini-interactions block to the same 3.x set and correct
gemini-3.1-flash-lite -> gemini-3.1-flash-lite-preview.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Merge remote-tracking branch 'origin/main' into pr-502-501-feat-ai-gemini-expose-stateful-interactions-api-previous-interaction-id
* Merge remote-tracking branch 'origin/main' into pr-502-501-feat-ai-gemini-expose-stateful-interactions-api-previous-interaction-id
* fix(ai-gemini): relocate experimental/ to flattened path + restore vite entry
Main's packages/typescript/* -> packages/* flatten (PR #643) missed the
experimental/ subtree introduced on this branch — git left it at the
old path and the merged vite.config dropped the experimental entry. Move
the files with `git mv` and re-add the entry so the /experimental subpath
emits its runtime JS again.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ai-groq): drop phantom experimental/ vite entry from merge
The packages/typescript -> packages/ flatten in main combined with this
branch's edit to gemini's vite.config triggered git's rename detection to
3-way-swap ai-gemini, ai-grok, and ai-groq vite configs. The experimental
entry meant for ai-gemini landed on ai-groq, which has no experimental
folder — the build failed to resolve the entry. Drop the spurious entry.
Also fix a stale `packages/typescript/ai-gemini/...` path reference in the
stateful-interactions spec comment.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b50d63e commit 65c917e
31 files changed
Lines changed: 3694 additions & 207 deletions
File tree
- .changeset
- docs/adapters
- examples/ts-react-chat/src
- lib
- routes
- packages/ai-gemini
- src/experimental
- text-interactions
- tests
- testing/e2e
- fixtures/stateful-interactions
- src
- components
- lib
- routes
- $provider
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
113 | 305 | | |
114 | 306 | | |
115 | 307 | | |
116 | 308 | | |
117 | 309 | | |
118 | 310 | | |
119 | | - | |
| 311 | + | |
120 | 312 | | |
121 | 313 | | |
122 | 314 | | |
| |||
159 | 351 | | |
160 | 352 | | |
161 | 353 | | |
162 | | - | |
| 354 | + | |
163 | 355 | | |
164 | 356 | | |
165 | 357 | | |
| |||
275 | 467 | | |
276 | 468 | | |
277 | 469 | | |
278 | | - | |
| 470 | + | |
279 | 471 | | |
280 | 472 | | |
281 | 473 | | |
| |||
332 | 524 | | |
333 | 525 | | |
334 | 526 | | |
335 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
336 | 537 | | |
337 | 538 | | |
338 | 539 | | |
| |||
380 | 581 | | |
381 | 582 | | |
382 | 583 | | |
383 | | - | |
| 584 | + | |
384 | 585 | | |
385 | 586 | | |
386 | 587 | | |
| |||
399 | 600 | | |
400 | 601 | | |
401 | 602 | | |
402 | | - | |
| 603 | + | |
403 | 604 | | |
404 | 605 | | |
405 | 606 | | |
| |||
423 | 624 | | |
424 | 625 | | |
425 | 626 | | |
426 | | - | |
| 627 | + | |
427 | 628 | | |
428 | 629 | | |
429 | 630 | | |
| |||
443 | 644 | | |
444 | 645 | | |
445 | 646 | | |
446 | | - | |
| 647 | + | |
447 | 648 | | |
448 | 649 | | |
449 | 650 | | |
| |||
467 | 668 | | |
468 | 669 | | |
469 | 670 | | |
470 | | - | |
| 671 | + | |
471 | 672 | | |
472 | 673 | | |
473 | 674 | | |
| |||
486 | 687 | | |
487 | 688 | | |
488 | 689 | | |
489 | | - | |
| 690 | + | |
490 | 691 | | |
491 | 692 | | |
492 | 693 | | |
| |||
506 | 707 | | |
507 | 708 | | |
508 | 709 | | |
509 | | - | |
| 710 | + | |
510 | 711 | | |
511 | 712 | | |
512 | 713 | | |
| |||
0 commit comments