@assistant-ui/mcp-docs-server 0.1.30 → 0.1.31
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.
- package/.docs/organized/code-examples/waterfall.md +1 -1
- package/.docs/organized/code-examples/with-a2a.md +2 -2
- package/.docs/organized/code-examples/with-ag-ui.md +3 -3
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +5 -5
- package/.docs/organized/code-examples/with-artifacts.md +5 -5
- package/.docs/organized/code-examples/with-assistant-transport.md +3 -3
- package/.docs/organized/code-examples/with-chain-of-thought.md +79 -50
- package/.docs/organized/code-examples/with-cloud-standalone.md +4 -4
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +56 -11
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +7 -7
- package/.docs/organized/code-examples/with-expo.md +16 -16
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -5
- package/.docs/organized/code-examples/with-generative-ui.md +5 -5
- package/.docs/organized/code-examples/with-google-adk.md +4 -4
- package/.docs/organized/code-examples/with-heat-graph.md +1 -1
- package/.docs/organized/code-examples/with-interactables.md +5 -5
- package/.docs/organized/code-examples/with-langchain.md +3 -3
- package/.docs/organized/code-examples/with-langgraph.md +3 -3
- package/.docs/organized/code-examples/with-livekit.md +8 -8
- package/.docs/organized/code-examples/with-opencode.md +99 -54
- package/.docs/organized/code-examples/with-parent-id-grouping.md +4 -4
- package/.docs/organized/code-examples/with-react-hook-form.md +5 -5
- package/.docs/organized/code-examples/with-react-ink.md +1 -1
- package/.docs/organized/code-examples/with-react-router.md +8 -8
- package/.docs/organized/code-examples/with-store.md +1 -1
- package/.docs/organized/code-examples/with-tanstack.md +5 -5
- package/.docs/organized/code-examples/with-tap-runtime.md +2 -2
- package/.docs/raw/docs/(docs)/cli.mdx +2 -1
- package/.docs/raw/docs/(docs)/copilots/assistant-frame.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +10 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-visible.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/use-assistant-instructions.mdx +1 -0
- package/.docs/raw/docs/(docs)/devtools.mdx +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +1 -0
- package/.docs/raw/docs/(docs)/installation.mdx +1 -0
- package/.docs/raw/docs/(docs)/rtl.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +34 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +41 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +34 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +31 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +72 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +41 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +48 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +23 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +21 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +7 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +65 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +50 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +15 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +36 -1
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +38 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +5 -0
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +144 -6
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +230 -2
- package/.docs/raw/docs/cloud/ai-sdk.mdx +221 -3
- package/.docs/raw/docs/cloud/langgraph.mdx +274 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/attachments.mdx +41 -36
- package/.docs/raw/docs/guides/branching.mdx +76 -0
- package/.docs/raw/docs/guides/chain-of-thought.mdx +166 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/context-api.mdx +50 -22
- package/.docs/raw/docs/{(docs)/guides → guides}/dictation.mdx +2 -0
- package/.docs/raw/docs/guides/editing.mdx +102 -0
- package/.docs/raw/docs/guides/index.mdx +103 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/interactables.mdx +49 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/latex.mdx +51 -8
- package/.docs/raw/docs/{(docs)/guides → guides}/mentions.mdx +61 -86
- package/.docs/raw/docs/{(docs)/guides → guides}/message-timing.mdx +8 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/multi-agent.mdx +64 -4
- package/.docs/raw/docs/{(docs)/guides → guides}/quoting.mdx +10 -17
- package/.docs/raw/docs/{(docs)/guides → guides}/slash-commands.mdx +103 -37
- package/.docs/raw/docs/guides/speech.mdx +156 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/suggestions.mdx +21 -83
- package/.docs/raw/docs/{(docs)/guides → guides}/tool-ui.mdx +108 -36
- package/.docs/raw/docs/{(docs)/guides → guides}/tools.mdx +131 -35
- package/.docs/raw/docs/{(docs)/guides → guides}/voice.mdx +39 -0
- package/.docs/raw/docs/ink/index.mdx +1 -3
- package/.docs/raw/docs/ink/migration.mdx +1 -3
- package/.docs/raw/docs/ink/primitives.mdx +37 -1
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +520 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +191 -0
- package/.docs/raw/docs/integrations/auth/clerk.mdx +172 -0
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +196 -0
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +79 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +188 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +57 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +201 -0
- package/.docs/raw/docs/integrations/gateways/index.mdx +157 -0
- package/.docs/raw/docs/integrations/index.mdx +173 -0
- package/.docs/raw/docs/integrations/observability/helicone.mdx +130 -0
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +156 -0
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +146 -0
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +712 -0
- package/.docs/raw/docs/integrations/tools/mcp.mdx +267 -0
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -0
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/primitives/attachment.mdx +1 -0
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +90 -85
- package/.docs/raw/docs/primitives/composer.mdx +2 -1
- package/.docs/raw/docs/primitives/error.mdx +1 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -1
- package/.docs/raw/docs/primitives/message.mdx +68 -5
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -0
- package/.docs/raw/docs/primitives/suggestion.mdx +1 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +39 -0
- package/.docs/raw/docs/primitives/thread.mdx +16 -13
- package/.docs/raw/docs/react-native/index.mdx +1 -3
- package/.docs/raw/docs/react-native/migration.mdx +1 -3
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +396 -0
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +60 -0
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +216 -0
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +70 -0
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +243 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +123 -0
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +52 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +71 -131
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +69 -63
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +330 -123
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +265 -0
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +125 -0
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +67 -0
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +428 -0
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +703 -0
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +323 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +253 -1236
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +746 -0
- package/.docs/raw/docs/runtimes/custom/overview.mdx +71 -0
- package/.docs/raw/docs/runtimes/google-adk/api.mdx +256 -0
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +717 -0
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +69 -0
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +229 -0
- package/.docs/raw/docs/runtimes/langchain.mdx +533 -0
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +305 -0
- package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +104 -0
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +84 -0
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +496 -0
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +127 -0
- package/.docs/raw/docs/runtimes/langgraph/threads.mdx +113 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -23
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +191 -0
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +48 -0
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +119 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +71 -203
- package/.docs/raw/docs/ui/accordion.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -0
- package/.docs/raw/docs/ui/attachment.mdx +1 -0
- package/.docs/raw/docs/ui/badge.mdx +1 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +1 -0
- package/.docs/raw/docs/ui/context-display.mdx +1 -0
- package/.docs/raw/docs/ui/diff-viewer.mdx +1 -0
- package/.docs/raw/docs/ui/directive-text.mdx +1 -0
- package/.docs/raw/docs/ui/file.mdx +1 -0
- package/.docs/raw/docs/ui/image.mdx +1 -0
- package/.docs/raw/docs/ui/markdown.mdx +2 -14
- package/.docs/raw/docs/ui/mermaid.mdx +1 -0
- package/.docs/raw/docs/ui/message-timing.mdx +3 -2
- package/.docs/raw/docs/ui/model-selector.mdx +1 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +325 -313
- package/.docs/raw/docs/ui/quote.mdx +1 -0
- package/.docs/raw/docs/ui/reasoning.mdx +66 -33
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -0
- package/.docs/raw/docs/ui/select.mdx +1 -0
- package/.docs/raw/docs/ui/sources.mdx +1 -0
- package/.docs/raw/docs/ui/streamdown.mdx +1 -0
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -0
- package/.docs/raw/docs/ui/tabs.mdx +1 -0
- package/.docs/raw/docs/ui/thread-list.mdx +17 -0
- package/.docs/raw/docs/ui/thread.mdx +56 -1
- package/.docs/raw/docs/ui/tool-fallback.mdx +1 -0
- package/.docs/raw/docs/ui/tool-group.mdx +39 -11
- package/.docs/raw/docs/ui/voice.mdx +1 -0
- package/.docs/raw/docs/utilities/heat-graph.mdx +1 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +278 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +1 -0
- package/package.json +3 -3
- package/src/tools/tests/path-traversal.test.ts +1 -1
- package/.docs/raw/docs/(docs)/guides/branching.mdx +0 -65
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +0 -164
- package/.docs/raw/docs/(docs)/guides/editing.mdx +0 -66
- package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -38
- package/.docs/raw/docs/runtimes/a2a/index.mdx +0 -298
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +0 -1033
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +0 -314
- package/.docs/raw/docs/runtimes/custom/local.mdx +0 -1464
- package/.docs/raw/docs/runtimes/data-stream.mdx +0 -422
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +0 -686
- package/.docs/raw/docs/runtimes/helicone.mdx +0 -61
- package/.docs/raw/docs/runtimes/langchain/comparison.mdx +0 -60
- package/.docs/raw/docs/runtimes/langchain/index.mdx +0 -210
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +0 -699
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +0 -12
- package/.docs/raw/docs/runtimes/langserve.mdx +0 -116
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -218
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +0 -18
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -217
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: Connect to Google ADK agents with streaming, tool calls, and multi-agent support.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`@assistant-ui/react-google-adk` integrates with [Google ADK JS](https://github.com/google/adk-js), Google's official agent framework for TypeScript, and works with ADK Python backends as well. It supports streaming text, tool calls, multi-agent orchestration, code execution, session state, tool confirmations, auth flows, and input requests.
|
|
7
|
+
|
|
8
|
+
## When to use it
|
|
9
|
+
|
|
10
|
+
Pick the Google ADK runtime when:
|
|
11
|
+
|
|
12
|
+
- You are building agents with ADK JS (`LlmAgent`, sequential / parallel / loop agents) or ADK Python.
|
|
13
|
+
- You want first-class support for ADK's HITL (human-in-the-loop) primitives: tool confirmations, auth credential flow, workflow input requests.
|
|
14
|
+
- You need multi-agent author and branch tracking, agent transfer events, and grounding / citation metadata.
|
|
15
|
+
|
|
16
|
+
## Architecture
|
|
17
|
+
|
|
18
|
+
`@assistant-ui/react-google-adk` is layered on `ExternalStoreRuntime` (see [architecture](/docs/runtimes/concepts/architecture)). Features that ship as runtime adapters work the same way they do everywhere else; see [adapters](/docs/runtimes/concepts/adapters).
|
|
19
|
+
|
|
20
|
+
The package automatically normalizes snake_case event fields from ADK Python backends to camelCase. No configuration is needed; connect to either ADK JS or ADK Python servers. All nested fields (`function_call` → `functionCall`, `requested_tool_confirmations` → `requestedToolConfirmations`) are handled.
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
- A Google ADK agent running on a server (ADK JS or ADK Python).
|
|
25
|
+
- React 18 or 19.
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
<PlatformTabs>
|
|
30
|
+
<Tab value="React">
|
|
31
|
+
|
|
32
|
+
<InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-google-adk", "@google/adk"]} />
|
|
33
|
+
|
|
34
|
+
</Tab>
|
|
35
|
+
<Tab value="React Native">
|
|
36
|
+
|
|
37
|
+
<InstallCommand expo={["@assistant-ui/react-native", "@assistant-ui/react-google-adk"]} />
|
|
38
|
+
|
|
39
|
+
</Tab>
|
|
40
|
+
<Tab value="React Ink">
|
|
41
|
+
|
|
42
|
+
<InstallCommand npm={["@assistant-ui/react-ink", "@assistant-ui/react-google-adk", "ink", "react"]} />
|
|
43
|
+
|
|
44
|
+
</Tab>
|
|
45
|
+
</PlatformTabs>
|
|
46
|
+
|
|
47
|
+
<Callout type="info">
|
|
48
|
+
`@google/adk` is only needed on the server side. The client-side runtime has no dependency on it.
|
|
49
|
+
</Callout>
|
|
50
|
+
|
|
51
|
+
## Next
|
|
52
|
+
|
|
53
|
+
<Cards>
|
|
54
|
+
<Card
|
|
55
|
+
title="Quickstart"
|
|
56
|
+
description="Minimal API route + client setup with createAdkApiRoute."
|
|
57
|
+
href="/docs/runtimes/google-adk/quickstart"
|
|
58
|
+
/>
|
|
59
|
+
<Card
|
|
60
|
+
title="API reference"
|
|
61
|
+
description="createAdkStream, server helpers, session adapter, threads, message editing."
|
|
62
|
+
href="/docs/runtimes/google-adk/api"
|
|
63
|
+
/>
|
|
64
|
+
<Card
|
|
65
|
+
title="Hooks"
|
|
66
|
+
description="Tool confirmations, auth, input requests, artifacts, escalation, metadata."
|
|
67
|
+
href="/docs/runtimes/google-adk/hooks"
|
|
68
|
+
/>
|
|
69
|
+
</Cards>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quickstart
|
|
3
|
+
description: Minimal API route and client setup with createAdkApiRoute.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Four steps to a working ADK chat. Assumes you have already installed the package and have ADK ready on the server side; if not, start at [overview](/docs/runtimes/google-adk).
|
|
7
|
+
|
|
8
|
+
<Steps>
|
|
9
|
+
<Step>
|
|
10
|
+
|
|
11
|
+
### Create a backend API endpoint
|
|
12
|
+
|
|
13
|
+
Use `createAdkApiRoute` to create an API route in one line:
|
|
14
|
+
For React Native and Ink, host this route in a separate backend project and
|
|
15
|
+
point the client runtime at its absolute URL.
|
|
16
|
+
|
|
17
|
+
```ts title="app/api/chat/route.ts"
|
|
18
|
+
import { createAdkApiRoute } from "@assistant-ui/react-google-adk/server";
|
|
19
|
+
import { InMemoryRunner, LlmAgent } from "@google/adk";
|
|
20
|
+
|
|
21
|
+
const agent = new LlmAgent({
|
|
22
|
+
name: "my_agent",
|
|
23
|
+
model: "gemini-2.5-flash",
|
|
24
|
+
instruction: "You are a helpful assistant.",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const runner = new InMemoryRunner({ agent, appName: "my-app" });
|
|
28
|
+
|
|
29
|
+
export const POST = createAdkApiRoute({
|
|
30
|
+
runner,
|
|
31
|
+
userId: "user_1",
|
|
32
|
+
sessionId: (req) =>
|
|
33
|
+
new URL(req.url).searchParams.get("sessionId") ?? "default",
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Both `userId` and `sessionId` accept either a static string or `(req: Request) => string` for dynamic resolution from cookies, headers, or query params.
|
|
38
|
+
|
|
39
|
+
</Step>
|
|
40
|
+
<Step>
|
|
41
|
+
|
|
42
|
+
### Set up the client runtime
|
|
43
|
+
|
|
44
|
+
Use `createAdkStream` to connect to your API route. No manual SSE parsing needed:
|
|
45
|
+
|
|
46
|
+
<PlatformTabs>
|
|
47
|
+
<Tab value="React">
|
|
48
|
+
|
|
49
|
+
```tsx title="components/MyAssistant.tsx"
|
|
50
|
+
"use client";
|
|
51
|
+
|
|
52
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
53
|
+
import {
|
|
54
|
+
useAdkRuntime,
|
|
55
|
+
createAdkStream,
|
|
56
|
+
} from "@assistant-ui/react-google-adk";
|
|
57
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
58
|
+
|
|
59
|
+
export function MyAssistant() {
|
|
60
|
+
const runtime = useAdkRuntime({
|
|
61
|
+
stream: createAdkStream({ api: "/api/chat" }),
|
|
62
|
+
});
|
|
63
|
+
return (
|
|
64
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
65
|
+
<Thread />
|
|
66
|
+
</AssistantRuntimeProvider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
</Tab>
|
|
72
|
+
<Tab value="React Native">
|
|
73
|
+
|
|
74
|
+
```tsx title="components/MyAssistant.tsx"
|
|
75
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react-native";
|
|
76
|
+
import {
|
|
77
|
+
useAdkRuntime,
|
|
78
|
+
createAdkStream,
|
|
79
|
+
} from "@assistant-ui/react-google-adk";
|
|
80
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
81
|
+
|
|
82
|
+
const API_URL = process.env.EXPO_PUBLIC_API_URL ?? "http://localhost:3000";
|
|
83
|
+
|
|
84
|
+
export function MyAssistant() {
|
|
85
|
+
const runtime = useAdkRuntime({
|
|
86
|
+
stream: createAdkStream({ api: `${API_URL}/api/chat` }),
|
|
87
|
+
});
|
|
88
|
+
return (
|
|
89
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
90
|
+
<Thread />
|
|
91
|
+
</AssistantRuntimeProvider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
</Tab>
|
|
97
|
+
<Tab value="React Ink">
|
|
98
|
+
|
|
99
|
+
```tsx title="components/MyAssistant.tsx"
|
|
100
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react-ink";
|
|
101
|
+
import {
|
|
102
|
+
useAdkRuntime,
|
|
103
|
+
createAdkStream,
|
|
104
|
+
} from "@assistant-ui/react-google-adk";
|
|
105
|
+
import { Thread } from "./thread.js";
|
|
106
|
+
|
|
107
|
+
export function MyAssistant() {
|
|
108
|
+
const runtime = useAdkRuntime({
|
|
109
|
+
stream: createAdkStream({ api: "http://localhost:3000/api/chat" }),
|
|
110
|
+
});
|
|
111
|
+
return (
|
|
112
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
113
|
+
<Thread />
|
|
114
|
+
</AssistantRuntimeProvider>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
</Tab>
|
|
120
|
+
</PlatformTabs>
|
|
121
|
+
|
|
122
|
+
</Step>
|
|
123
|
+
<Step>
|
|
124
|
+
|
|
125
|
+
### Use the component
|
|
126
|
+
|
|
127
|
+
<PlatformTabs>
|
|
128
|
+
<Tab value="React">
|
|
129
|
+
|
|
130
|
+
```tsx title="app/page.tsx"
|
|
131
|
+
import { MyAssistant } from "@/components/MyAssistant";
|
|
132
|
+
|
|
133
|
+
export default function Home() {
|
|
134
|
+
return (
|
|
135
|
+
<main className="h-dvh">
|
|
136
|
+
<MyAssistant />
|
|
137
|
+
</main>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
</Tab>
|
|
143
|
+
<Tab value="React Native">
|
|
144
|
+
|
|
145
|
+
```tsx title="app/index.tsx"
|
|
146
|
+
import { View } from "react-native";
|
|
147
|
+
import { MyAssistant } from "@/components/MyAssistant";
|
|
148
|
+
|
|
149
|
+
export default function Home() {
|
|
150
|
+
return (
|
|
151
|
+
<View style={{ flex: 1 }}>
|
|
152
|
+
<MyAssistant />
|
|
153
|
+
</View>
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
</Tab>
|
|
159
|
+
<Tab value="React Ink">
|
|
160
|
+
|
|
161
|
+
```tsx title="app.tsx"
|
|
162
|
+
import { Box } from "ink";
|
|
163
|
+
import { MyAssistant } from "./components/MyAssistant.js";
|
|
164
|
+
|
|
165
|
+
export function App() {
|
|
166
|
+
return (
|
|
167
|
+
<Box flexDirection="column">
|
|
168
|
+
<MyAssistant />
|
|
169
|
+
</Box>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
</Tab>
|
|
175
|
+
</PlatformTabs>
|
|
176
|
+
|
|
177
|
+
</Step>
|
|
178
|
+
<Step>
|
|
179
|
+
|
|
180
|
+
### Set up UI components
|
|
181
|
+
|
|
182
|
+
<PlatformTabs>
|
|
183
|
+
<Tab value="React">
|
|
184
|
+
|
|
185
|
+
Follow the [UI Components guide](/docs/ui/thread) to wire up the Thread, composer, and supporting primitives.
|
|
186
|
+
|
|
187
|
+
</Tab>
|
|
188
|
+
<Tab value="React Native">
|
|
189
|
+
|
|
190
|
+
Follow the [React Native setup](/docs/react-native) to add a native Thread, composer, and supporting primitives.
|
|
191
|
+
|
|
192
|
+
</Tab>
|
|
193
|
+
<Tab value="React Ink">
|
|
194
|
+
|
|
195
|
+
Follow the [Ink setup](/docs/ink) to add a terminal Thread, composer, and supporting primitives.
|
|
196
|
+
|
|
197
|
+
</Tab>
|
|
198
|
+
</PlatformTabs>
|
|
199
|
+
|
|
200
|
+
</Step>
|
|
201
|
+
</Steps>
|
|
202
|
+
|
|
203
|
+
## Adding adapters
|
|
204
|
+
|
|
205
|
+
Attachments, speech, feedback, history, and a custom thread list are supported via the standard adapter slots. See [adapters](/docs/runtimes/concepts/adapters):
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
const runtime = useAdkRuntime({
|
|
209
|
+
stream: createAdkStream({ api: "/api/chat" }),
|
|
210
|
+
adapters: { attachments, history, speech, feedback },
|
|
211
|
+
});
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
For multi-thread, see [threads](/docs/runtimes/concepts/threads).
|
|
215
|
+
|
|
216
|
+
## Next
|
|
217
|
+
|
|
218
|
+
<Cards>
|
|
219
|
+
<Card
|
|
220
|
+
title="API reference"
|
|
221
|
+
description="createAdkStream, server helpers, session adapter, threads, message editing."
|
|
222
|
+
href="/docs/runtimes/google-adk/api"
|
|
223
|
+
/>
|
|
224
|
+
<Card
|
|
225
|
+
title="Hooks"
|
|
226
|
+
description="Tool confirmations, auth, input requests, artifacts, escalation, metadata."
|
|
227
|
+
href="/docs/runtimes/google-adk/hooks"
|
|
228
|
+
/>
|
|
229
|
+
</Cards>
|