@assistant-ui/mcp-docs-server 0.1.19 → 0.1.21
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/with-ag-ui.md +172 -1633
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +42 -1640
- package/.docs/organized/code-examples/with-assistant-transport.md +40 -1743
- package/.docs/organized/code-examples/with-cloud.md +71 -1745
- package/.docs/organized/code-examples/with-custom-thread-list.md +87 -1723
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +70 -1637
- package/.docs/organized/code-examples/with-external-store.md +67 -1624
- package/.docs/organized/code-examples/with-ffmpeg.md +71 -1629
- package/.docs/organized/code-examples/with-langgraph.md +95 -1893
- package/.docs/organized/code-examples/with-parent-id-grouping.md +57 -1654
- package/.docs/organized/code-examples/with-react-hook-form.md +220 -2163
- package/.docs/organized/code-examples/with-react-router.md +66 -1318
- package/.docs/organized/code-examples/with-store.md +31 -31
- package/.docs/organized/code-examples/with-tanstack.md +77 -861
- package/.docs/organized/code-examples/with-tap-runtime.md +812 -0
- package/.docs/raw/docs/(docs)/cli.mdx +66 -0
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -1
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -1
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +4 -4
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +3 -3
- package/.docs/raw/docs/(docs)/devtools.mdx +0 -1
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +2 -3
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +117 -117
- package/.docs/raw/docs/(docs)/guides/suggestions.mdx +296 -0
- package/.docs/raw/docs/(docs)/guides/tools.mdx +336 -513
- package/.docs/raw/docs/(docs)/index.mdx +33 -410
- package/.docs/raw/docs/(docs)/installation.mdx +450 -0
- package/.docs/raw/docs/(docs)/llm.mdx +209 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +48 -3
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +9 -3
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +20 -52
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +16 -39
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +49 -50
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +3 -11
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +0 -3
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +5 -16
- package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +152 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +28 -40
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +2 -3
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +1 -2
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +0 -1
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +1 -2
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -1
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +5 -5
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -1
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -1
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +207 -33
- package/.docs/raw/docs/(reference)/react-compatibility.mdx +0 -1
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +0 -1
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +0 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +0 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +118 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +198 -0
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +3 -3
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +5 -6
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -11
- package/.docs/raw/docs/runtimes/custom/local.mdx +43 -36
- package/.docs/raw/docs/runtimes/data-stream.mdx +35 -3
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +1 -2
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +0 -1
- package/.docs/raw/docs/runtimes/langserve.mdx +0 -1
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -1
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -1
- package/.docs/raw/docs/ui/accordion.mdx +259 -0
- package/.docs/raw/docs/ui/assistant-modal.mdx +1 -3
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -3
- package/.docs/raw/docs/ui/attachment.mdx +0 -2
- package/.docs/raw/docs/ui/badge.mdx +138 -0
- package/.docs/raw/docs/ui/diff-viewer.mdx +279 -0
- package/.docs/raw/docs/ui/file.mdx +152 -0
- package/.docs/raw/docs/ui/image.mdx +100 -0
- package/.docs/raw/docs/ui/markdown.mdx +0 -1
- package/.docs/raw/docs/ui/mermaid.mdx +0 -1
- package/.docs/raw/docs/ui/model-selector.mdx +224 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +4 -5
- package/.docs/raw/docs/ui/reasoning.mdx +6 -5
- package/.docs/raw/docs/ui/scrollbar.mdx +26 -9
- package/.docs/raw/docs/ui/select.mdx +245 -0
- package/.docs/raw/docs/ui/sources.mdx +6 -5
- package/.docs/raw/docs/ui/streamdown.mdx +348 -0
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +8 -63
- package/.docs/raw/docs/ui/tabs.mdx +259 -0
- package/.docs/raw/docs/ui/thread-list.mdx +98 -16
- package/.docs/raw/docs/ui/thread.mdx +57 -73
- package/.docs/raw/docs/ui/tool-fallback.mdx +0 -1
- package/.docs/raw/docs/ui/tool-group.mdx +1 -3
- package/README.md +3 -3
- package/package.json +4 -4
- package/src/tools/tests/examples.test.ts +1 -1
- package/.docs/raw/docs/(docs)/about-assistantui.mdx +0 -54
- package/.docs/raw/docs/(docs)/mcp-docs-server.mdx +0 -321
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +0 -219
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: SuggestionPrimitive
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
Primitives for rendering individual suggestions. These primitives must be used within a suggestion context provided by `ThreadPrimitive.Suggestions`.
|
|
7
|
+
|
|
8
|
+
## Quick Reference
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { SuggestionPrimitive } from "@assistant-ui/react";
|
|
12
|
+
|
|
13
|
+
<SuggestionPrimitive.Title />
|
|
14
|
+
<SuggestionPrimitive.Description />
|
|
15
|
+
<SuggestionPrimitive.Trigger />
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## API Reference
|
|
19
|
+
|
|
20
|
+
### `SuggestionPrimitive.Title`
|
|
21
|
+
|
|
22
|
+
Displays the suggestion's title.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { SuggestionPrimitive } from "@assistant-ui/react";
|
|
26
|
+
|
|
27
|
+
const SuggestionCard = () => {
|
|
28
|
+
return (
|
|
29
|
+
<div>
|
|
30
|
+
<h3>
|
|
31
|
+
<SuggestionPrimitive.Title />
|
|
32
|
+
</h3>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
This primitive renders a `<span>` element.
|
|
39
|
+
|
|
40
|
+
### `SuggestionPrimitive.Description`
|
|
41
|
+
|
|
42
|
+
Displays the suggestion's description/label. This is only shown when suggestions are configured using the object format with separate title and label.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { SuggestionPrimitive } from "@assistant-ui/react";
|
|
46
|
+
|
|
47
|
+
const SuggestionCard = () => {
|
|
48
|
+
return (
|
|
49
|
+
<div>
|
|
50
|
+
<p className="text-muted-foreground">
|
|
51
|
+
<SuggestionPrimitive.Description />
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This primitive renders a `<span>` element.
|
|
59
|
+
|
|
60
|
+
### `SuggestionPrimitive.Trigger`
|
|
61
|
+
|
|
62
|
+
A button that triggers the suggestion action when clicked. When clicked, it either sends the message immediately or populates the composer with the suggestion's prompt.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { SuggestionPrimitive } from "@assistant-ui/react";
|
|
66
|
+
|
|
67
|
+
const SuggestionButton = () => {
|
|
68
|
+
return (
|
|
69
|
+
<SuggestionPrimitive.Trigger send asChild>
|
|
70
|
+
<button>
|
|
71
|
+
<SuggestionPrimitive.Title />
|
|
72
|
+
</button>
|
|
73
|
+
</SuggestionPrimitive.Trigger>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<ParametersTable
|
|
79
|
+
type="SuggestionPrimitiveTriggerProps"
|
|
80
|
+
parameters={[
|
|
81
|
+
{
|
|
82
|
+
name: "send",
|
|
83
|
+
type: "boolean",
|
|
84
|
+
description:
|
|
85
|
+
"When true, automatically sends the message. When false, only populates the composer with the suggestion's prompt.",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "clearComposer",
|
|
89
|
+
type: "boolean",
|
|
90
|
+
default: "true",
|
|
91
|
+
description:
|
|
92
|
+
"When send is false, determines whether to clear the composer before adding the suggestion (true) or append to existing text (false).",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "asChild",
|
|
96
|
+
type: "boolean",
|
|
97
|
+
default: "false",
|
|
98
|
+
description: "Merge props with child element instead of rendering a wrapper button.",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "className",
|
|
102
|
+
type: "string",
|
|
103
|
+
description: "CSS class name.",
|
|
104
|
+
},
|
|
105
|
+
]}
|
|
106
|
+
/>
|
|
107
|
+
|
|
108
|
+
This primitive renders a `<button>` element unless `asChild` is set.
|
|
109
|
+
|
|
110
|
+
## Usage Example
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
import {
|
|
114
|
+
ThreadPrimitive,
|
|
115
|
+
SuggestionPrimitive,
|
|
116
|
+
} from "@assistant-ui/react";
|
|
117
|
+
|
|
118
|
+
const ThreadWelcome = () => {
|
|
119
|
+
return (
|
|
120
|
+
<div>
|
|
121
|
+
<h1>How can I help you?</h1>
|
|
122
|
+
<div className="grid grid-cols-2 gap-2">
|
|
123
|
+
<ThreadPrimitive.Suggestions
|
|
124
|
+
components={{
|
|
125
|
+
Suggestion: SuggestionCard,
|
|
126
|
+
}}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const SuggestionCard = () => {
|
|
134
|
+
return (
|
|
135
|
+
<SuggestionPrimitive.Trigger send asChild>
|
|
136
|
+
<button className="flex flex-col gap-1 rounded-lg border p-3 hover:bg-muted">
|
|
137
|
+
<span className="font-medium">
|
|
138
|
+
<SuggestionPrimitive.Title />
|
|
139
|
+
</span>
|
|
140
|
+
<span className="text-muted-foreground text-sm">
|
|
141
|
+
<SuggestionPrimitive.Description />
|
|
142
|
+
</span>
|
|
143
|
+
</button>
|
|
144
|
+
</SuggestionPrimitive.Trigger>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## See Also
|
|
150
|
+
|
|
151
|
+
- [Suggestions Guide](/docs/guides/suggestions) - Configure and customize suggestions
|
|
152
|
+
- [ThreadPrimitive.Suggestions](/docs/reference/api-reference/primitives/thread#threadprimitive-suggestions) - Render all suggestions
|
|
@@ -5,7 +5,6 @@ description: Dropdown menu for additional thread actions like archive and delete
|
|
|
5
5
|
|
|
6
6
|
A dropdown menu for displaying additional actions on a thread list item. Built on top of [Radix UI Dropdown Menu](https://www.radix-ui.com/primitives/docs/components/dropdown-menu).
|
|
7
7
|
|
|
8
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
8
|
|
|
10
9
|
## Anatomy
|
|
11
10
|
|
|
@@ -5,7 +5,6 @@ description: Individual thread item with title, archive, and delete controls.
|
|
|
5
5
|
|
|
6
6
|
A single thread item within a thread list.
|
|
7
7
|
|
|
8
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
8
|
|
|
10
9
|
## Anatomy
|
|
11
10
|
|
|
@@ -158,4 +157,4 @@ const ArchivedThreadListItem = () => {
|
|
|
158
157
|
</ThreadListItemPrimitive.Root>
|
|
159
158
|
);
|
|
160
159
|
};
|
|
161
|
-
```
|
|
160
|
+
```
|
|
@@ -5,7 +5,6 @@ description: Display and manage multiple conversation threads with create and ar
|
|
|
5
5
|
|
|
6
6
|
Displays a list of conversation threads.
|
|
7
7
|
|
|
8
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
8
|
|
|
10
9
|
## Anatomy
|
|
11
10
|
|
|
@@ -126,4 +125,4 @@ Renders a single thread list item at the specified index.
|
|
|
126
125
|
description: "The components to render for the thread list item.",
|
|
127
126
|
},
|
|
128
127
|
]}
|
|
129
|
-
/>
|
|
128
|
+
/>
|
|
@@ -5,7 +5,6 @@ description: Primitives for the message list, viewport, and welcome screen.
|
|
|
5
5
|
|
|
6
6
|
A conversation between a user and an assistant.
|
|
7
7
|
|
|
8
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
8
|
|
|
10
9
|
## Anatomy
|
|
11
10
|
|
|
@@ -183,57 +182,46 @@ This primitive renders a `<button>` element unless `asChild` is set.
|
|
|
183
182
|
]}
|
|
184
183
|
/>
|
|
185
184
|
|
|
186
|
-
### `ThreadPrimitive.
|
|
185
|
+
### `ThreadPrimitive.Suggestions`
|
|
187
186
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
This primitive renders a `<button>` element unless `asChild` is set.
|
|
187
|
+
Renders all configured suggestions from the Suggestions API. Each suggestion is rendered using the provided Suggestion component.
|
|
191
188
|
|
|
192
189
|
```tsx
|
|
193
|
-
import { ThreadPrimitive } from "@assistant-ui/react";
|
|
190
|
+
import { ThreadPrimitive, SuggestionPrimitive } from "@assistant-ui/react";
|
|
194
191
|
|
|
195
|
-
const
|
|
192
|
+
const SuggestionsList = () => {
|
|
196
193
|
return (
|
|
197
|
-
<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
194
|
+
<div className="grid grid-cols-2 gap-2">
|
|
195
|
+
<ThreadPrimitive.Suggestions
|
|
196
|
+
components={{
|
|
197
|
+
Suggestion: SuggestionItem,
|
|
198
|
+
}}
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
201
|
);
|
|
202
202
|
};
|
|
203
|
+
|
|
204
|
+
const SuggestionItem = () => (
|
|
205
|
+
<SuggestionPrimitive.Trigger send asChild>
|
|
206
|
+
<button className="p-3 border rounded">
|
|
207
|
+
<SuggestionPrimitive.Title />
|
|
208
|
+
<SuggestionPrimitive.Description />
|
|
209
|
+
</button>
|
|
210
|
+
</SuggestionPrimitive.Trigger>
|
|
211
|
+
);
|
|
203
212
|
```
|
|
204
213
|
|
|
205
214
|
<ParametersTable
|
|
206
|
-
type="
|
|
215
|
+
type="ThreadPrimitiveSuggestionsProps"
|
|
207
216
|
parameters={[
|
|
208
217
|
{
|
|
209
|
-
name: "
|
|
210
|
-
type: "
|
|
211
|
-
description: "
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
name: "send",
|
|
215
|
-
type: "boolean",
|
|
216
|
-
description:
|
|
217
|
-
"When true, automatically sends the message. When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`",
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: "clearComposer",
|
|
221
|
-
type: "boolean",
|
|
222
|
-
default: "true",
|
|
223
|
-
description:
|
|
224
|
-
"Whether to clear the composer after sending. When send is set to false, determines if composer text is replaced with suggestion (true, default), or if the suggestion's prompt is appended to the composer text (false).",
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
name: "autoSend",
|
|
228
|
-
type: "boolean",
|
|
229
|
-
deprecated: true,
|
|
230
|
-
description: "Deprecated. Use 'send' instead.",
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
name: "method",
|
|
234
|
-
type: "'replace'",
|
|
235
|
-
deprecated: true,
|
|
236
|
-
description: "Deprecated. This parameter is no longer used.",
|
|
218
|
+
name: "components",
|
|
219
|
+
type: "{ Suggestion: ComponentType }",
|
|
220
|
+
description: "Custom component to render each suggestion.",
|
|
237
221
|
},
|
|
238
222
|
]}
|
|
239
223
|
/>
|
|
224
|
+
|
|
225
|
+
<Callout type="info">
|
|
226
|
+
Configure suggestions using the `Suggestions()` API in your runtime provider. See the [Suggestions guide](/docs/guides/suggestions) for details.
|
|
227
|
+
</Callout>
|
|
@@ -3,7 +3,6 @@ title: AssistantRuntime
|
|
|
3
3
|
description: Root runtime for managing threads, tool UIs, and assistant state.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
6
|
import { AssistantRuntime, AssistantToolUIsState } from "@/generated/typeDocs";
|
|
8
7
|
|
|
9
8
|
The `AssistantRuntime` is the root runtime of the application.
|
|
@@ -3,11 +3,10 @@ title: AttachmentRuntime
|
|
|
3
3
|
description: Hooks for accessing attachment state in composer and messages.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
6
|
import {
|
|
8
7
|
ComposerAttachmentState,
|
|
9
8
|
MessageAttachmentState,
|
|
10
|
-
} from "@/components/docs/
|
|
9
|
+
} from "@/components/docs/parameters-table.context";
|
|
11
10
|
|
|
12
11
|
### `useAttachment`
|
|
13
12
|
|
|
@@ -5,7 +5,6 @@ description: Runtime for programmatically controlling the message composer.
|
|
|
5
5
|
|
|
6
6
|
The composer runtime allows you to view or edit anything related to how new information is added and sent. For instance you can use the composer runtime to read the state, add attachments, update text, send a message, etc.
|
|
7
7
|
|
|
8
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
9
8
|
import { ComposerRuntime, ThreadComposerRuntime, ThreadComposerState, EditComposerState } from "@/generated/typeDocs";
|
|
10
9
|
|
|
11
10
|
### `useComposerRuntime`
|
|
@@ -21,7 +20,7 @@ const composerRuntime = useComposerRuntime();
|
|
|
21
20
|
// set the text
|
|
22
21
|
composerRuntime.setText("Hello from the composer runtime");
|
|
23
22
|
|
|
24
|
-
// send whatever is in the composer
|
|
23
|
+
// send whatever is in the composer
|
|
25
24
|
composerRuntime.send();
|
|
26
25
|
|
|
27
26
|
// get the current text in the composer state
|
|
@@ -45,7 +44,7 @@ const threadComposerRuntime = useThreadComposer();
|
|
|
45
44
|
// set the text
|
|
46
45
|
threadComposerRuntime.setText("Hello from the thread composer runtime");
|
|
47
46
|
|
|
48
|
-
// send whatever is in the thread composer
|
|
47
|
+
// send whatever is in the thread composer
|
|
49
48
|
threadComposerRuntime.send();
|
|
50
49
|
|
|
51
50
|
// get the current text in the composer state
|
|
@@ -3,8 +3,7 @@ title: MessagePartRuntime
|
|
|
3
3
|
description: Hook for accessing message part state within parts.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { MessagePartState } from "@/components/docs/tables/parameters/context";
|
|
6
|
+
import { MessagePartState } from "@/components/docs/parameters-table.context";
|
|
8
7
|
|
|
9
8
|
### `useMessagePart`
|
|
10
9
|
|
|
@@ -3,12 +3,11 @@ title: MessageRuntime
|
|
|
3
3
|
description: Hooks for accessing message state, utilities, and edit composer.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
6
|
import {
|
|
8
7
|
MessageState,
|
|
9
8
|
MessageUtilsState,
|
|
10
9
|
EditComposerState,
|
|
11
|
-
} from "@/components/docs/
|
|
10
|
+
} from "@/components/docs/parameters-table.context";
|
|
12
11
|
|
|
13
12
|
### `useMessage`
|
|
14
13
|
|
|
@@ -3,7 +3,6 @@ title: ThreadListRuntime
|
|
|
3
3
|
description: Runtime for accessing and managing the list of threads.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
6
|
import { ThreadListRuntime, ThreadListState } from "@/generated/typeDocs";
|
|
8
7
|
|
|
9
8
|
### Access via `useAssistantRuntime`
|
|
@@ -3,9 +3,8 @@ title: ThreadRuntime
|
|
|
3
3
|
description: Runtime for thread state, messages, and viewport management.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ParametersTable } from "@/components/docs/tables/ParametersTable";
|
|
7
6
|
import { ThreadRuntime, ThreadState } from "@/generated/typeDocs";
|
|
8
|
-
import {
|
|
7
|
+
import { ThreadViewportState } from "@/components/docs/parameters-table.context";
|
|
9
8
|
|
|
10
9
|
### `useThreadRuntime`
|
|
11
10
|
|
|
@@ -176,17 +176,17 @@ The button to send or cancel the message.
|
|
|
176
176
|
|
|
177
177
|
```tsx
|
|
178
178
|
import { Composer } from "@assistant-ui/react-ui";
|
|
179
|
-
import {
|
|
179
|
+
import { AuiIf } from "@assistant-ui/react";
|
|
180
180
|
|
|
181
181
|
const MyComposerAction: FC = () => {
|
|
182
182
|
return (
|
|
183
183
|
<>
|
|
184
|
-
<
|
|
184
|
+
<AuiIf condition={({ thread }) => !thread.isRunning}>
|
|
185
185
|
<Composer.Send />
|
|
186
|
-
</
|
|
187
|
-
<
|
|
186
|
+
</AuiIf>
|
|
187
|
+
<AuiIf condition={({ thread }) => thread.isRunning}>
|
|
188
188
|
<Composer.Cancel />
|
|
189
|
-
</
|
|
189
|
+
</AuiIf>
|
|
190
190
|
</>
|
|
191
191
|
);
|
|
192
192
|
};
|