-
-
Notifications
You must be signed in to change notification settings - Fork 209
feat(ai-gemini): add geminiTextInteractions() adapter for stateful Interactions API #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tombeckenham
wants to merge
31
commits into
TanStack:main
Choose a base branch
from
tombeckenham:501-feat-ai-gemini-expose-stateful-interactions-api-previous-interaction-id
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d726e67
feat(ai-gemini): add geminiTextInteractions() adapter for stateful Inβ¦
tombeckenham 44b1602
ci: apply automated fixes
autofix-ci[bot] 4c1f6e5
refactor(ai-gemini): surface interactionId via CUSTOM event, drop corβ¦
tombeckenham 8fac6ee
fix(ai-gemini): address CodeRabbit review feedback on Interactions adβ¦
tombeckenham 61ed535
ci: apply automated fixes
autofix-ci[bot] 1bac2e0
fix(ai-gemini): emit RUN_ERROR with spec-compliant flat message/code
tombeckenham b2dd5ff
feat(examples): wire Gemini Interactions into ts-react-chat, refresh β¦
tombeckenham 97438ed
test(ai-gemini): route adapter tests through public core APIs
tombeckenham 45f8db6
feat(ai-gemini): built-in tools on geminiTextInteractions()
tombeckenham 0669a1b
ci: apply automated fixes
autofix-ci[bot] 6dc4798
ci: apply automated fixes (attempt 2/3)
autofix-ci[bot] fa0d53f
refactor(ai-gemini)!: gate `geminiTextInteractions` behind `/experimeβ¦
tombeckenham 9d3e662
chore(ai-gemini): consolidate `geminiTextInteractions` changesets
tombeckenham b546fe0
Marked gemini interactions as experimental in example
tombeckenham 6a85261
test(e2e): wire up stateful-interactions spec for geminiTextInteractions
tombeckenham a7f68f3
chore(e2e): drop stale "aimock doesn't mock interactions" note
tombeckenham 6a1c073
ci: apply automated fixes
autofix-ci[bot] b35fcc8
chore(e2e): bump @copilotkit/aimock to ^1.24.1
tombeckenham 72aa0f2
feat(ai-gemini): include threadId + parentRunId on Interactions RUN_Sβ¦
tombeckenham 459e820
feat(ai-gemini): export GeminiInteractionsCustomEvent discriminated uβ¦
tombeckenham 3001023
fix(ai-gemini): send Interactions input as string | Content[], not Tuβ¦
tombeckenham 2d951eb
ci: apply automated fixes
autofix-ci[bot] 1946844
fix(ai-gemini): wire useChat into the Interactions API correctly
tombeckenham de9bffa
fix(ai-gemini): correctly format Interactions API wire requests
tombeckenham 671ab02
fix(ai-gemini): tighten experimental Interactions adapter type safetyβ¦
tombeckenham 6a24270
ci: apply automated fixes
autofix-ci[bot] 9421005
fix(ai-gemini): plug interactionId map leak; verify E2E chains the id
tombeckenham 75407b1
fix(ai-gemini): evict interactionId on abandonment after tool_calls turn
tombeckenham e754db5
fix(ai-gemini): seal truncated AG-UI events + preserve interactionId β¦
tombeckenham a2aed43
docs(ai-gemini): correct stale API Reference signatures
tombeckenham c933cba
chore(e2e): consistent error handling + harden stateful-interactions β¦
tombeckenham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| '@tanstack/ai-gemini': minor | ||
| --- | ||
|
|
||
| feat(ai-gemini): add experimental `geminiTextInteractions()` adapter for Gemini's stateful Interactions API (Beta) | ||
|
|
||
| Routes through `client.interactions.create` instead of `client.models.generateContent`, so callers can pass `previous_interaction_id` via `modelOptions` and let the server retain conversation history. On each run, the returned interaction id is surfaced via an AG-UI `CUSTOM` event (`name: 'gemini.interactionId'`) emitted just before `RUN_FINISHED` β feed it back on the next turn via `modelOptions.previous_interaction_id`. | ||
|
|
||
| Exported from a dedicated `@tanstack/ai-gemini/experimental` subpath so the experimental status is load-bearing in your editor and bundle: | ||
|
|
||
| ```ts | ||
| import { geminiTextInteractions } from '@tanstack/ai-gemini/experimental' | ||
| ``` | ||
|
|
||
| Scope: text/chat output with function tools, plus the built-in tools `google_search`, `code_execution`, `url_context`, `file_search`, and `computer_use`. Built-in tool activity is surfaced as AG-UI `CUSTOM` events named `gemini.googleSearchCall` / `gemini.googleSearchResult` (and the matching `codeExecutionCall`/`Result`, `urlContextCall`/`Result`, `fileSearchCall`/`Result` variants), carrying the raw Interactions delta payload. Function-tool `TOOL_CALL_*` events are unchanged, and `finishReason` stays `stop` when only built-in tools ran β the core chat loop has nothing to execute. | ||
|
|
||
| `google_search_retrieval`, `google_maps`, and `mcp_server` are not supported on this adapter and throw a targeted error explaining the alternative. Image/audio output via Interactions is also not routed through this adapter β use `geminiText()`, `geminiImage`, or `geminiSpeech` for those. | ||
|
|
||
| Marked `@experimental` β the underlying Interactions API is Beta and Google explicitly flags possible breaking changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.