@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: CLI
|
|
3
3
|
description: Scaffold projects, add components, and manage updates from the command line.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Use the `assistant-ui` CLI to quickly set up new projects and add components to existing ones.
|
|
@@ -68,7 +69,7 @@ Use `--example` to create a project from one of the monorepo examples with full
|
|
|
68
69
|
| `with-artifacts` | HTML artifact rendering with live preview | `npx assistant-ui create my-app -e with-artifacts` |
|
|
69
70
|
| `with-langgraph` | LangGraph agent with custom tools | `npx assistant-ui create my-app -e with-langgraph` |
|
|
70
71
|
| `with-cloud` | Assistant Cloud persistence | `npx assistant-ui create my-app -e with-cloud` |
|
|
71
|
-
| `with-ag-ui` | AG-UI protocol integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
72
|
+
| `with-ag-ui` | [AG-UI protocol](/docs/runtimes/ag-ui) integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
72
73
|
| `with-assistant-transport` | Custom backend via Assistant Transport | `npx assistant-ui create my-app -e with-assistant-transport` |
|
|
73
74
|
| `with-chain-of-thought` | Chain-of-thought with JS execution | `npx assistant-ui create my-app -e with-chain-of-thought` |
|
|
74
75
|
| `with-external-store` | External message store | `npx assistant-ui create my-app -e with-external-store` |
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Assistant Frame API
|
|
3
3
|
description: Share model context across iframe boundaries
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
The Assistant Frame API enables iframes to provide model context (tools and instructions) to a parent window's assistant. This is particularly useful for embedded applications, plugins, or sandboxed components that need to contribute capabilities to the main assistant.
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: makeAssistantToolUI
|
|
3
3
|
description: Register custom UI components to render tool executions and their status.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
<Callout type="
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
<Callout type="info">
|
|
8
|
+
Prefer pre-registering tool UIs via the [`Tools()` API](/docs/guides/tools)
|
|
9
|
+
(set `render` on the tool definition) or by mounting `makeAssistantToolUI`
|
|
10
|
+
near the root of your tree. A tool UI that is only registered while a
|
|
11
|
+
specific component is mounted will not appear when chat history is replayed
|
|
12
|
+
or during server-side rendering, since the registering component may not be
|
|
13
|
+
mounted at that point. Tool execution can still be registered dynamically
|
|
14
|
+
via [`makeAssistantTool`](/docs/copilots/make-assistant-tool); this caveat
|
|
15
|
+
applies specifically to the UI render function.
|
|
9
16
|
</Callout>
|
|
10
17
|
|
|
11
18
|
The `makeAssistantToolUI` utility is used to register a tool UI component with the Assistant.
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: makeAssistantTool
|
|
3
3
|
description: Create React components that provide reusable tools to the assistant.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
<Callout type="
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
<Callout type="info">
|
|
8
|
+
For most apps, the [`Tools()` API](/docs/guides/tools) is an easier starting
|
|
9
|
+
point: tool definitions live in a toolkit object rather than the component
|
|
10
|
+
tree. `makeAssistantTool` is fully supported and remains a good fit when a
|
|
11
|
+
tool's availability is tied to a component being mounted, for example a
|
|
12
|
+
product-specific tool that should only be exposed while that product's UI is
|
|
13
|
+
on screen (the [intelligent components](/docs/copilots/motivation) pattern).
|
|
9
14
|
</Callout>
|
|
10
15
|
|
|
11
16
|
`makeAssistantTool` creates a React component that provides a tool to the assistant. This is useful for defining reusable tools that can be composed into your application.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: makeAssistantVisible
|
|
3
3
|
description: Make React components visible and interactive to assistants via higher-order component wrapping.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
`makeAssistantVisible` is a higher-order component (HOC) that makes React components "visible" by the assistant, allowing it to understand and interact with the component's HTML structure.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Model Context
|
|
3
3
|
description: Configure assistant behavior through system instructions, tools, and context providers.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Model Context is the foundation of intelligence in assistant-ui components. It provides configuration and capabilities to the assistant through a context provider system.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Intelligent Components
|
|
3
3
|
description: Add intelligence to React components through readable interfaces and assistant tools.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
React revolutionized web development with components that combine logic, structure, and style. Now, with assistant-ui, we're adding a fourth dimension: intelligence. Let's learn how to build smart components through a practical banking app example.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: useAssistantInstructions
|
|
3
3
|
description: React hook for setting system instructions to guide assistant behavior.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
`useAssistantInstructions` is a React hook that allows you to set system instructions for your assistant-ui components.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: RTL Support
|
|
3
3
|
description: Use assistant-ui with right-to-left languages like Arabic, Hebrew, and Persian.
|
|
4
|
+
platforms: ["react"]
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Components shipped through `@assistant-ui/ui` (npm) and the shadcn registry (`npx shadcn@latest add https://r.assistant-ui.com/...`) use logical Tailwind classes (`ms-*`, `pe-*`, `text-start`, `end-*`, `border-s`, ...). They flip automatically under `dir="rtl"` and render byte-identically under `dir="ltr"` (the default) — there is nothing to opt out of.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Attachment Adapters
|
|
3
|
+
description: Upload and compose file attachment handlers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Attachment adapters control how files become assistant-ui attachments.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
CompositeAttachmentAdapter,
|
|
11
|
+
SimpleImageAttachmentAdapter,
|
|
12
|
+
SimpleTextAttachmentAdapter,
|
|
13
|
+
useLocalRuntime,
|
|
14
|
+
} from "@assistant-ui/react";
|
|
15
|
+
|
|
16
|
+
const attachments = new CompositeAttachmentAdapter([
|
|
17
|
+
new SimpleImageAttachmentAdapter(),
|
|
18
|
+
new SimpleTextAttachmentAdapter(),
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
const runtime = useLocalRuntime(chatModelAdapter, {
|
|
22
|
+
adapters: { attachments },
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Common Exports
|
|
27
|
+
|
|
28
|
+
- `AttachmentAdapter` is the interface for custom attachment handling.
|
|
29
|
+
- `SimpleImageAttachmentAdapter` converts supported image files.
|
|
30
|
+
- `SimpleTextAttachmentAdapter` converts supported text files.
|
|
31
|
+
- `CompositeAttachmentAdapter` tries multiple attachment adapters in order.
|
|
32
|
+
- `CloudFileAttachmentAdapter` uploads files through Assistant Cloud.
|
|
33
|
+
|
|
34
|
+
For a custom implementation guide, see [Custom Attachment Adapter](/docs/integrations/attachments/custom-adapter).
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Feedback and Speech Adapters
|
|
3
|
+
description: Capture message feedback and connect speech or dictation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Feedback
|
|
7
|
+
|
|
8
|
+
`FeedbackAdapter` receives message feedback submitted through action primitives or runtime actions.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
const runtime = useLocalRuntime(chatModelAdapter, {
|
|
12
|
+
adapters: {
|
|
13
|
+
feedback: {
|
|
14
|
+
submit: async ({ message, type }) => {
|
|
15
|
+
await fetch("/api/feedback", {
|
|
16
|
+
method: "POST",
|
|
17
|
+
body: JSON.stringify({ messageId: message.id, type }),
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Speech
|
|
26
|
+
|
|
27
|
+
`SpeechSynthesisAdapter` controls text-to-speech playback. `WebSpeechSynthesisAdapter` provides a browser implementation.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { WebSpeechSynthesisAdapter } from "@assistant-ui/react";
|
|
31
|
+
|
|
32
|
+
const runtime = useLocalRuntime(chatModelAdapter, {
|
|
33
|
+
adapters: {
|
|
34
|
+
speech: new WebSpeechSynthesisAdapter(),
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Dictation and Suggestions
|
|
40
|
+
|
|
41
|
+
Runtime adapters can also provide dictation and suggestion behavior. Dictation powers composer voice input; suggestions power prompt suggestions rendered by thread and suggestion primitives.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: Interfaces for persistence, files, speech, dictation, feedback, suggestions, and runtime composition.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
|
|
7
|
+
{/* Do not edit manually. */}
|
|
8
|
+
|
|
9
|
+
Adapters let you replace runtime behavior without replacing the UI. They are usually passed through runtime options or provided by integration packages.
|
|
10
|
+
|
|
11
|
+
## Pages
|
|
12
|
+
|
|
13
|
+
<Cards>
|
|
14
|
+
<Card title={"Runtime Adapter Context"} href={"/docs/api-reference/adapters/runtime"}>
|
|
15
|
+
{"Provide runtime adapters through React context."}
|
|
16
|
+
</Card>
|
|
17
|
+
<Card title={"Attachment Adapters"} href={"/docs/api-reference/adapters/attachments"}>
|
|
18
|
+
{"Upload and compose file attachment handlers."}
|
|
19
|
+
</Card>
|
|
20
|
+
<Card title={"Persistence Adapters"} href={"/docs/api-reference/adapters/persistence"}>
|
|
21
|
+
{"Persist message history and thread lists."}
|
|
22
|
+
</Card>
|
|
23
|
+
<Card title={"Feedback and Speech Adapters"} href={"/docs/api-reference/adapters/feedback-speech"}>
|
|
24
|
+
{"Capture message feedback and connect speech or dictation."}
|
|
25
|
+
</Card>
|
|
26
|
+
</Cards>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Persistence Adapters
|
|
3
|
+
description: Persist message history and thread lists.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
assistant-ui has two persistence layers:
|
|
7
|
+
|
|
8
|
+
- `ThreadHistoryAdapter` persists messages for a single runtime thread.
|
|
9
|
+
- `RemoteThreadListAdapter` manages a backend-backed list of threads, including creating, loading, archiving, deleting, and title generation.
|
|
10
|
+
|
|
11
|
+
## Thread History
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
const runtime = useLocalRuntime(chatModelAdapter, {
|
|
15
|
+
adapters: {
|
|
16
|
+
history: myHistoryAdapter,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use a history adapter when the app has one active thread or when thread list management lives somewhere else.
|
|
22
|
+
|
|
23
|
+
## Remote Thread Lists
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
const runtime = useRemoteThreadListRuntime({
|
|
27
|
+
adapter: myRemoteThreadListAdapter,
|
|
28
|
+
runtimeHook: () => useLocalRuntime(chatModelAdapter),
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Use a remote thread list adapter when your backend owns conversation metadata and users can switch between many threads.
|
|
33
|
+
|
|
34
|
+
Assistant Cloud provides managed persistence through `AssistantCloud` and cloud runtime helpers. See [Threads](/docs/runtimes/concepts/threads) for the full threading model.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Runtime Adapter Context
|
|
3
|
+
description: Provide runtime adapters through React context.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
`RuntimeAdapterProvider` lets framework integrations provide adapters around a runtime hook instead of threading them through every hook call.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
RuntimeAdapterProvider,
|
|
11
|
+
useLocalRuntime,
|
|
12
|
+
} from "@assistant-ui/react";
|
|
13
|
+
|
|
14
|
+
function RuntimeRoot({ children }) {
|
|
15
|
+
return (
|
|
16
|
+
<RuntimeAdapterProvider
|
|
17
|
+
adapters={{
|
|
18
|
+
history,
|
|
19
|
+
attachments,
|
|
20
|
+
feedback,
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</RuntimeAdapterProvider>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Runtime hooks merge context adapters with hook-specific options. Hook options are the right place for per-runtime configuration; the provider is useful when an integration or backend wrapper owns the adapter setup.
|
|
30
|
+
|
|
31
|
+
Use `useRuntimeAdapters` only when building a runtime integration that needs to read the adapter context directly.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: Context providers that establish assistant-ui runtime and message-part scopes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
|
|
7
|
+
{/* Do not edit manually. */}
|
|
8
|
+
|
|
9
|
+
Context providers establish the scopes that primitives and hooks read from. Most apps only use `AssistantRuntimeProvider` directly; lower-level providers are for custom renderers and advanced composition.
|
|
10
|
+
|
|
11
|
+
## Pages
|
|
12
|
+
|
|
13
|
+
<Cards>
|
|
14
|
+
<Card title={"<AssistantRuntimeProvider />"} href={"/docs/api-reference/context-providers/assistant-runtime-provider"}>
|
|
15
|
+
{"Root provider that connects your runtime to assistant-ui components."}
|
|
16
|
+
</Card>
|
|
17
|
+
<Card title={"<TextMessagePartProvider />"} href={"/docs/api-reference/context-providers/text-message-part-provider"}>
|
|
18
|
+
{"Context provider for reusing text components outside of message content."}
|
|
19
|
+
</Card>
|
|
20
|
+
</Cards>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: Reactive state, runtime creation, model context, and utility hooks for React.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
|
|
7
|
+
{/* Do not edit manually. */}
|
|
8
|
+
|
|
9
|
+
Hooks are the programmatic layer of `@assistant-ui/react`. Use them when primitives are not enough: reading state, creating runtimes, registering tools, wiring model context, or building custom behavior around the assistant runtime.
|
|
10
|
+
|
|
11
|
+
## Pages
|
|
12
|
+
|
|
13
|
+
<Cards>
|
|
14
|
+
<Card title={"State Hooks"} href={"/docs/api-reference/hooks/state"}>
|
|
15
|
+
{"Read assistant state and call runtime actions."}
|
|
16
|
+
</Card>
|
|
17
|
+
<Card title={"Runtime Hooks"} href={"/docs/api-reference/hooks/runtimes"}>
|
|
18
|
+
{"Hooks for creating assistant runtimes."}
|
|
19
|
+
</Card>
|
|
20
|
+
<Card title={"Model Context Hooks"} href={"/docs/api-reference/hooks/model-context"}>
|
|
21
|
+
{"Register instructions, tools, tool UIs, and data renderers."}
|
|
22
|
+
</Card>
|
|
23
|
+
<Card title={"Utility Hooks"} href={"/docs/api-reference/hooks/utilities"}>
|
|
24
|
+
{"Focused helpers for message parts, quotes, timing, and viewport behavior."}
|
|
25
|
+
</Card>
|
|
26
|
+
</Cards>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Model Context Hooks
|
|
3
|
+
description: Register instructions, tools, tool UIs, and data renderers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Model context hooks let React components contribute model-facing configuration while they are mounted.
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { useAssistantInstructions } from "@assistant-ui/react";
|
|
12
|
+
|
|
13
|
+
useAssistantInstructions("Answer with concise examples.");
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Tools
|
|
17
|
+
|
|
18
|
+
`useAssistantTool` registers a tool definition, optional `execute` function, and optional renderer.
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { useAssistantTool } from "@assistant-ui/react";
|
|
22
|
+
|
|
23
|
+
useAssistantTool({
|
|
24
|
+
toolName: "get_weather",
|
|
25
|
+
description: "Get the current weather for a city",
|
|
26
|
+
parameters: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
city: { type: "string" },
|
|
30
|
+
},
|
|
31
|
+
required: ["city"],
|
|
32
|
+
},
|
|
33
|
+
execute: async ({ city }) => ({ city, temperature: 72 }),
|
|
34
|
+
render: ({ args, result }) => (
|
|
35
|
+
<div>
|
|
36
|
+
{args.city}: {result?.temperature}F
|
|
37
|
+
</div>
|
|
38
|
+
),
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Tool UI
|
|
43
|
+
|
|
44
|
+
Use `useAssistantToolUI` when the backend or model already owns the tool definition and the frontend only needs to render calls.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { useAssistantToolUI } from "@assistant-ui/react";
|
|
48
|
+
|
|
49
|
+
useAssistantToolUI({
|
|
50
|
+
toolName: "get_weather",
|
|
51
|
+
render: ({ args, result, status }) => (
|
|
52
|
+
<div>{status.type === "running" ? "Loading..." : result?.summary}</div>
|
|
53
|
+
),
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Data UI
|
|
58
|
+
|
|
59
|
+
`useAssistantDataUI` renders named data message parts.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { useAssistantDataUI } from "@assistant-ui/react";
|
|
63
|
+
|
|
64
|
+
useAssistantDataUI({
|
|
65
|
+
name: "weather_card",
|
|
66
|
+
render: ({ data }) => <WeatherCard data={data} />,
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Declarative Registration
|
|
71
|
+
|
|
72
|
+
`makeAssistantTool` and `makeAssistantToolUI` create components that register model context when mounted. They are useful when tools should live in JSX alongside the feature that owns them.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Runtime Hooks
|
|
3
|
+
description: Hooks for creating assistant runtimes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Runtime hooks create the `AssistantRuntime` passed to `AssistantRuntimeProvider`.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import {
|
|
10
|
+
AssistantRuntimeProvider,
|
|
11
|
+
useLocalRuntime,
|
|
12
|
+
} from "@assistant-ui/react";
|
|
13
|
+
|
|
14
|
+
function App() {
|
|
15
|
+
const runtime = useLocalRuntime(chatModelAdapter);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
19
|
+
{children}
|
|
20
|
+
</AssistantRuntimeProvider>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Core Runtime Hooks
|
|
26
|
+
|
|
27
|
+
- [`useLocalRuntime`](/docs/runtimes/custom/local-runtime) creates a runtime from a `ChatModelAdapter`.
|
|
28
|
+
- [`useRemoteThreadListRuntime`](/docs/runtimes/concepts/threads) adds backend-backed thread list management.
|
|
29
|
+
- [`useExternalStoreRuntime`](/docs/runtimes/custom/external-store) adapts an external message store.
|
|
30
|
+
- [`useAssistantTransportRuntime`](/docs/runtimes/custom/assistant-transport) consumes assistant-stream transport events.
|
|
31
|
+
|
|
32
|
+
## Integration Runtime Hooks
|
|
33
|
+
|
|
34
|
+
- [`useChatRuntime`](/docs/runtimes/ai-sdk/overview) adapts AI SDK chat helpers.
|
|
35
|
+
- [`useDataStreamRuntime`](/docs/runtimes/custom/data-stream) adapts assistant-stream data streams.
|
|
36
|
+
- [`useLangGraphRuntime`](/docs/runtimes/langgraph/overview) adapts LangGraph.
|
|
37
|
+
- [`useCloudThreadListRuntime`](/docs/cloud) uses Assistant Cloud for thread persistence.
|
|
38
|
+
|
|
39
|
+
## Runtime Options
|
|
40
|
+
|
|
41
|
+
Most runtime hooks accept adapters for persistence, attachments, speech, dictation, feedback, and suggestions. See [Adapters](/docs/api-reference/adapters) for the adapter map.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: State Hooks
|
|
3
|
+
description: Read assistant state and call runtime actions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## useAuiState
|
|
7
|
+
|
|
8
|
+
`useAuiState` is the primary hook for reactive state. Pass a selector and the component re-renders when the selected value changes.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
12
|
+
|
|
13
|
+
const messages = useAuiState((s) => s.thread.messages);
|
|
14
|
+
const isRunning = useAuiState((s) => s.thread.isRunning);
|
|
15
|
+
const composerText = useAuiState((s) => s.composer.text);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Selectors are scoped by context. Inside a message primitive, `s.message` refers to that message; inside an attachment primitive, `s.attachment` refers to that attachment.
|
|
19
|
+
|
|
20
|
+
## useAui
|
|
21
|
+
|
|
22
|
+
`useAui` returns the runtime action API. Use it for imperative operations such as sending composer text, cancelling a run, switching threads, or submitting feedback.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { useAui } from "@assistant-ui/react";
|
|
26
|
+
|
|
27
|
+
const aui = useAui();
|
|
28
|
+
|
|
29
|
+
aui.composer().setText("Hello");
|
|
30
|
+
aui.composer().send();
|
|
31
|
+
aui.thread().cancelRun();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Runtime action and state shapes are documented in the [Runtime State](/docs/api-reference/runtimes/assistant-runtime) section.
|
|
35
|
+
|
|
36
|
+
## useAuiEvent
|
|
37
|
+
|
|
38
|
+
`useAuiEvent` subscribes to runtime events without using the event as render state.
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { useAuiEvent } from "@assistant-ui/react";
|
|
42
|
+
|
|
43
|
+
useAuiEvent("thread.runStart", (payload) => {
|
|
44
|
+
console.log("Run started", payload);
|
|
45
|
+
});
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Use `useAuiEvent` for analytics, logging, or side effects that should not cause UI re-renders.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Utility Hooks
|
|
3
|
+
description: Focused helpers for message parts, quotes, timing, and viewport behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Utility hooks expose commonly needed slices of assistant-ui behavior without requiring a full primitive.
|
|
7
|
+
|
|
8
|
+
## Message Helpers
|
|
9
|
+
|
|
10
|
+
- `useMessageQuote` reads the quote state for the current message.
|
|
11
|
+
- `useMessageTiming` reads timing metadata for the current message.
|
|
12
|
+
|
|
13
|
+
## Message Part Helpers
|
|
14
|
+
|
|
15
|
+
- `useMessagePartText`
|
|
16
|
+
- `useMessagePartReasoning`
|
|
17
|
+
- `useMessagePartSource`
|
|
18
|
+
- `useMessagePartFile`
|
|
19
|
+
- `useMessagePartImage`
|
|
20
|
+
- `useMessagePartData`
|
|
21
|
+
|
|
22
|
+
These hooks are intended for custom message part renderers. They read the nearest message part context established by `MessagePrimitive.Parts`, `MessagePartPrimitive`, or the lower-level providers.
|
|
23
|
+
|
|
24
|
+
## Viewport Helpers
|
|
25
|
+
|
|
26
|
+
- `useThreadViewport` reads and controls the thread viewport.
|
|
27
|
+
- `useThreadViewportAutoScroll` wires auto-scroll behavior for custom viewport compositions.
|
|
28
|
+
- `useScrollLock` helps reasoning and grouped-part UIs preserve scroll behavior while content changes.
|
|
29
|
+
|
|
30
|
+
For primitive-specific prop APIs, see [Primitives](/docs/api-reference/primitives).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Overview
|
|
3
|
+
description: Package-level API reference for assistant-ui React integrations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
|
|
7
|
+
{/* Do not edit manually. */}
|
|
8
|
+
|
|
9
|
+
Integration packages adapt assistant-ui to framework libraries and adjacent React ecosystems. Use these pages when you need package-specific hook names, options, and helper exports.
|
|
10
|
+
|
|
11
|
+
## Pages
|
|
12
|
+
|
|
13
|
+
<Cards>
|
|
14
|
+
<Card title={"@assistant-ui/react-ai-sdk"} href={"/docs/api-reference/integrations/vercel-ai-sdk"}>
|
|
15
|
+
{"Vercel AI SDK integration with chat runtime hooks and transport utilities."}
|
|
16
|
+
</Card>
|
|
17
|
+
<Card title={"@assistant-ui/react-data-stream"} href={"/docs/api-reference/integrations/react-data-stream"}>
|
|
18
|
+
{"Hooks for connecting to data stream protocol endpoints and Assistant Cloud."}
|
|
19
|
+
</Card>
|
|
20
|
+
<Card title={"@assistant-ui/react-hook-form"} href={"/docs/api-reference/integrations/react-hook-form"}>
|
|
21
|
+
{"React Hook Form integration for AI-assisted form filling."}
|
|
22
|
+
</Card>
|
|
23
|
+
</Cards>
|
|
@@ -16,6 +16,27 @@ export const contextColors = {
|
|
|
16
16
|
"ThreadListItem Context": "#c678dd",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
## Start Here
|
|
20
|
+
|
|
21
|
+
The React API reference is organized by how you build with assistant-ui:
|
|
22
|
+
|
|
23
|
+
<Cards>
|
|
24
|
+
<Card title="Primitives" href="/docs/api-reference/primitives">
|
|
25
|
+
Composable React components such as `ThreadPrimitive`, `MessagePrimitive`, and `ComposerPrimitive`. These pages are generated from the package source where possible.
|
|
26
|
+
</Card>
|
|
27
|
+
<Card title="Hooks" href="/docs/api-reference/hooks">
|
|
28
|
+
Reactive state hooks, runtime hooks, model context hooks, and utility hooks.
|
|
29
|
+
</Card>
|
|
30
|
+
<Card title="Adapters" href="/docs/api-reference/adapters">
|
|
31
|
+
Runtime extension points for attachments, persistence, feedback, speech, dictation, and suggestions.
|
|
32
|
+
</Card>
|
|
33
|
+
<Card title="Runtime State" href="/docs/api-reference/runtimes/assistant-runtime">
|
|
34
|
+
Runtime action and state shapes used by `useAui` and `useAuiState`.
|
|
35
|
+
</Card>
|
|
36
|
+
</Cards>
|
|
37
|
+
|
|
38
|
+
The lower sections on this page show how the contexts nest and where each primitive, hook, and runtime object is available.
|
|
39
|
+
|
|
19
40
|
## Cloud
|
|
20
41
|
|
|
21
42
|
- [`AssistantCloud`](#assistant-cloud)
|
|
@@ -111,6 +111,13 @@ The condition function receives an `AssistantState` object with the following pr
|
|
|
111
111
|
<Disclaimer />
|
|
112
112
|
</AuiIf>
|
|
113
113
|
|
|
114
|
+
// Render content only after the assistant finishes streaming
|
|
115
|
+
<AuiIf condition={(s) =>
|
|
116
|
+
s.message.role === "assistant" && s.message.status?.type === "complete"
|
|
117
|
+
}>
|
|
118
|
+
<FollowUpCard />
|
|
119
|
+
</AuiIf>
|
|
120
|
+
|
|
114
121
|
// Toggle copy icon based on copied state
|
|
115
122
|
<ActionBarPrimitive.Copy>
|
|
116
123
|
<AuiIf condition={(s) => !s.message.isCopied}>
|