@assistant-ui/mcp-docs-server 0.1.14 → 0.1.16
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/store-example.md +628 -0
- package/.docs/organized/code-examples/with-ag-ui.md +792 -178
- package/.docs/organized/code-examples/with-ai-sdk-v5.md +762 -209
- package/.docs/organized/code-examples/with-assistant-transport.md +707 -254
- package/.docs/organized/code-examples/with-cloud.md +848 -202
- package/.docs/organized/code-examples/with-custom-thread-list.md +1855 -0
- package/.docs/organized/code-examples/with-external-store.md +788 -172
- package/.docs/organized/code-examples/with-ffmpeg.md +796 -196
- package/.docs/organized/code-examples/with-langgraph.md +864 -230
- package/.docs/organized/code-examples/with-parent-id-grouping.md +785 -255
- package/.docs/organized/code-examples/with-react-hook-form.md +804 -226
- package/.docs/organized/code-examples/with-tanstack.md +1574 -0
- package/.docs/raw/blog/2024-07-29-hello/index.mdx +2 -3
- package/.docs/raw/docs/api-reference/overview.mdx +6 -6
- package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +85 -4
- package/.docs/raw/docs/api-reference/primitives/AssistantIf.mdx +200 -0
- package/.docs/raw/docs/api-reference/primitives/Composer.mdx +0 -20
- package/.docs/raw/docs/api-reference/primitives/Message.mdx +0 -45
- package/.docs/raw/docs/api-reference/primitives/Thread.mdx +0 -50
- package/.docs/raw/docs/cli.mdx +396 -0
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
- package/.docs/raw/docs/cloud/persistence/langgraph.mdx +2 -3
- package/.docs/raw/docs/devtools.mdx +2 -3
- package/.docs/raw/docs/getting-started.mdx +37 -1109
- package/.docs/raw/docs/guides/Attachments.mdx +3 -25
- package/.docs/raw/docs/guides/Branching.mdx +1 -1
- package/.docs/raw/docs/guides/Speech.mdx +1 -1
- package/.docs/raw/docs/guides/ToolUI.mdx +1 -1
- package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +2 -3
- package/.docs/raw/docs/legacy/styled/Decomposition.mdx +6 -5
- package/.docs/raw/docs/legacy/styled/Markdown.mdx +2 -3
- package/.docs/raw/docs/legacy/styled/Thread.mdx +2 -3
- package/.docs/raw/docs/react-compatibility.mdx +2 -5
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +3 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +3 -6
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +891 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -3
- package/.docs/raw/docs/runtimes/custom/local.mdx +11 -41
- package/.docs/raw/docs/runtimes/data-stream.mdx +15 -11
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +4 -4
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -3
- package/.docs/raw/docs/runtimes/langserve.mdx +2 -3
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +2 -3
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +2 -3
- package/.docs/raw/docs/ui/AssistantModal.mdx +3 -25
- package/.docs/raw/docs/ui/AssistantSidebar.mdx +2 -24
- package/.docs/raw/docs/ui/Attachment.mdx +3 -25
- package/.docs/raw/docs/ui/Markdown.mdx +2 -24
- package/.docs/raw/docs/ui/Mermaid.mdx +2 -24
- package/.docs/raw/docs/ui/Reasoning.mdx +2 -24
- package/.docs/raw/docs/ui/Scrollbar.mdx +4 -6
- package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +3 -47
- package/.docs/raw/docs/ui/Thread.mdx +38 -53
- package/.docs/raw/docs/ui/ThreadList.mdx +4 -47
- package/.docs/raw/docs/ui/ToolFallback.mdx +2 -24
- package/package.json +15 -8
|
@@ -6,6 +6,7 @@ import { Callout } from "fumadocs-ui/components/callout";
|
|
|
6
6
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
7
7
|
import { Card, Cards } from "fumadocs-ui/components/card";
|
|
8
8
|
import { ParametersTable } from "@/components/docs";
|
|
9
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
10
|
|
|
10
11
|
## Overview
|
|
11
12
|
|
|
@@ -152,9 +153,7 @@ graph TD
|
|
|
152
153
|
<Step>
|
|
153
154
|
### Install Dependencies
|
|
154
155
|
|
|
155
|
-
|
|
156
|
-
npm install @assistant-ui/react
|
|
157
|
-
```
|
|
156
|
+
<InstallCommand npm={["@assistant-ui/react"]} />
|
|
158
157
|
|
|
159
158
|
</Step>
|
|
160
159
|
|
|
@@ -6,6 +6,7 @@ import { Callout } from "fumadocs-ui/components/callout";
|
|
|
6
6
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
7
7
|
import { Card, Cards } from "fumadocs-ui/components/card";
|
|
8
8
|
import { ParametersTable } from "@/components/docs";
|
|
9
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
10
|
|
|
10
11
|
## Overview
|
|
11
12
|
|
|
@@ -68,8 +69,15 @@ Use `LocalRuntime` if you need:
|
|
|
68
69
|
|
|
69
70
|
### Install `@assistant-ui/react`
|
|
70
71
|
|
|
72
|
+
<InstallCommand npm={["@assistant-ui/react"]} />
|
|
73
|
+
|
|
74
|
+
</Step>
|
|
75
|
+
<Step>
|
|
76
|
+
|
|
77
|
+
### Add `assistant-ui` Thread component
|
|
78
|
+
|
|
71
79
|
```sh npm2yarn
|
|
72
|
-
|
|
80
|
+
npx assistant-ui@latest add thread
|
|
73
81
|
```
|
|
74
82
|
|
|
75
83
|
</Step>
|
|
@@ -406,12 +414,11 @@ For custom thread storage, use `useRemoteThreadListRuntime` with your own adapte
|
|
|
406
414
|
|
|
407
415
|
```tsx
|
|
408
416
|
import {
|
|
409
|
-
useLocalThreadRuntime,
|
|
410
417
|
unstable_useRemoteThreadListRuntime as useRemoteThreadListRuntime,
|
|
411
418
|
useThreadListItem,
|
|
412
419
|
RuntimeAdapterProvider,
|
|
413
420
|
AssistantRuntimeProvider,
|
|
414
|
-
type RemoteThreadListAdapter,
|
|
421
|
+
type unstable_RemoteThreadListAdapter as RemoteThreadListAdapter,
|
|
415
422
|
type ThreadHistoryAdapter,
|
|
416
423
|
} from "@assistant-ui/react";
|
|
417
424
|
import { createAssistantStream } from "assistant-stream";
|
|
@@ -472,7 +479,7 @@ const myDatabaseAdapter: RemoteThreadListAdapter = {
|
|
|
472
479
|
export function MyRuntimeProvider({ children }) {
|
|
473
480
|
const runtime = useRemoteThreadListRuntime({
|
|
474
481
|
runtimeHook: () => {
|
|
475
|
-
return
|
|
482
|
+
return useLocalRuntime(MyModelAdapter);
|
|
476
483
|
},
|
|
477
484
|
adapter: {
|
|
478
485
|
...myDatabaseAdapter,
|
|
@@ -827,43 +834,6 @@ function MyComponent() {
|
|
|
827
834
|
}
|
|
828
835
|
```
|
|
829
836
|
|
|
830
|
-
### Custom Runtime Implementation
|
|
831
|
-
|
|
832
|
-
`useLocalThreadRuntime` provides the core single-thread runtime for building custom implementations:
|
|
833
|
-
|
|
834
|
-
```tsx
|
|
835
|
-
import {
|
|
836
|
-
useLocalThreadRuntime,
|
|
837
|
-
unstable_useRemoteThreadListRuntime as useRemoteThreadListRuntime,
|
|
838
|
-
AssistantRuntimeProvider,
|
|
839
|
-
} from "@assistant-ui/react";
|
|
840
|
-
|
|
841
|
-
// Build your own multi-thread runtime
|
|
842
|
-
function MyCustomRuntimeProvider({ children }) {
|
|
843
|
-
const runtime = useRemoteThreadListRuntime({
|
|
844
|
-
runtimeHook: () => useLocalThreadRuntime(MyModelAdapter, options),
|
|
845
|
-
adapter: myCustomThreadListAdapter,
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
return (
|
|
849
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
850
|
-
{children}
|
|
851
|
-
</AssistantRuntimeProvider>
|
|
852
|
-
);
|
|
853
|
-
}
|
|
854
|
-
```
|
|
855
|
-
|
|
856
|
-
<Callout type="info">
|
|
857
|
-
`useLocalRuntime` internally uses `useLocalThreadRuntime` +
|
|
858
|
-
`useRemoteThreadListRuntime` for multi-thread support.
|
|
859
|
-
</Callout>
|
|
860
|
-
|
|
861
|
-
<Callout type="warning">
|
|
862
|
-
**`useThreadRuntime` vs `useLocalThreadRuntime`:** - `useThreadRuntime` -
|
|
863
|
-
Access the current thread's runtime from within components -
|
|
864
|
-
`useLocalThreadRuntime` - Create a new single-thread runtime instance
|
|
865
|
-
</Callout>
|
|
866
|
-
|
|
867
837
|
## Integration Examples
|
|
868
838
|
|
|
869
839
|
### OpenAI Integration
|
|
@@ -4,6 +4,7 @@ title: Data Stream Protocol
|
|
|
4
4
|
|
|
5
5
|
import { Step, Steps } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
8
|
|
|
8
9
|
The `@assistant-ui/react-data-stream` package provides integration with data stream protocol endpoints, enabling streaming AI responses with tool support and state management.
|
|
9
10
|
|
|
@@ -19,9 +20,7 @@ The data stream protocol is a standardized format for streaming AI responses tha
|
|
|
19
20
|
|
|
20
21
|
## Installation
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
npm install @assistant-ui/react-data-stream
|
|
24
|
-
```
|
|
23
|
+
<InstallCommand npm={["@assistant-ui/react-data-stream"]} />
|
|
25
24
|
|
|
26
25
|
## Basic Usage
|
|
27
26
|
|
|
@@ -61,19 +60,24 @@ export default function ChatPage() {
|
|
|
61
60
|
Your backend endpoint should accept POST requests and return data stream responses:
|
|
62
61
|
|
|
63
62
|
```typescript title="app/api/chat/route.ts"
|
|
64
|
-
import {
|
|
63
|
+
import { createAssistantStreamResponse } from "assistant-stream";
|
|
65
64
|
|
|
66
65
|
export async function POST(request: Request) {
|
|
67
66
|
const { messages, tools, system } = await request.json();
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
return createAssistantStreamResponse(async (controller) => {
|
|
69
|
+
// Process the request with your AI provider
|
|
70
|
+
const stream = await processWithAI({
|
|
71
|
+
messages,
|
|
72
|
+
tools,
|
|
73
|
+
system,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Stream the response
|
|
77
|
+
for await (const chunk of stream) {
|
|
78
|
+
controller.appendText(chunk.text);
|
|
79
|
+
}
|
|
74
80
|
});
|
|
75
|
-
|
|
76
|
-
return new DataStreamResponse(stream);
|
|
77
81
|
}
|
|
78
82
|
```
|
|
79
83
|
|
|
@@ -36,6 +36,8 @@ NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID=your_graph_id
|
|
|
36
36
|
</Step>
|
|
37
37
|
</Steps>
|
|
38
38
|
|
|
39
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
40
|
+
|
|
39
41
|
## Installation in existing React project
|
|
40
42
|
|
|
41
43
|
<Steps>
|
|
@@ -43,9 +45,7 @@ NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID=your_graph_id
|
|
|
43
45
|
|
|
44
46
|
### Install dependencies
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
npm install @assistant-ui/react @assistant-ui/react-ui @assistant-ui/react-langgraph @langchain/langgraph-sdk
|
|
48
|
-
```
|
|
48
|
+
<InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-langgraph", "@langchain/langgraph-sdk"]} />
|
|
49
49
|
|
|
50
50
|
</Step>
|
|
51
51
|
<Step>
|
|
@@ -189,7 +189,7 @@ export const sendMessage = async (params: {
|
|
|
189
189
|
// ---cut---
|
|
190
190
|
"use client";
|
|
191
191
|
|
|
192
|
-
import { Thread } from "@/components/assistant-ui";
|
|
192
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
193
193
|
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
194
194
|
import { useLangGraphRuntime } from "@assistant-ui/react-langgraph";
|
|
195
195
|
|
|
@@ -276,7 +276,7 @@ Then create a new file under `/components/tools/ToolFallback.tsx` to define the
|
|
|
276
276
|
import { ToolCallMessagePartComponent } from "@assistant-ui/react";
|
|
277
277
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
278
278
|
import { useState } from "react";
|
|
279
|
-
import { Button } from "
|
|
279
|
+
import { Button } from "@/components/ui/button";
|
|
280
280
|
|
|
281
281
|
export const ToolFallback: ToolCallMessagePartComponent = ({
|
|
282
282
|
toolName,
|
|
@@ -5,6 +5,7 @@ title: "Part 3: Approval UI"
|
|
|
5
5
|
## Background: LangGraph implementation details
|
|
6
6
|
|
|
7
7
|
import Image from "next/image";
|
|
8
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
8
9
|
import approval from "./images/stockbroker-langgraph.png";
|
|
9
10
|
|
|
10
11
|
<Image
|
|
@@ -127,9 +128,7 @@ Finally, we add a `TransactionConfirmationPending` component to ask for approval
|
|
|
127
128
|
|
|
128
129
|
This requires shadcn/ui's `Card` and `Button` components. We will install them as a dependency.
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
npx shadcn@latest add card button
|
|
132
|
-
```
|
|
131
|
+
<InstallCommand shadcn={["card", "button"]} />
|
|
133
132
|
|
|
134
133
|
Then create a new file under `/components/tools/purchase-stock/transaction-confirmation-pending.tsx` to define the approval UI.
|
|
135
134
|
|
|
@@ -13,6 +13,7 @@ Integration with a LangServe server via Vercel AI SDK.
|
|
|
13
13
|
## Getting Started
|
|
14
14
|
|
|
15
15
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
16
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
16
17
|
|
|
17
18
|
<Steps>
|
|
18
19
|
<Step>
|
|
@@ -28,9 +29,7 @@ cd my-app
|
|
|
28
29
|
|
|
29
30
|
### Install `@langchain/core`, AI SDK and `@assistant-ui/react`
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
npm install @assistant-ui/react @assistant-ui/react-ai-sdk ai @ai-sdk/react @langchain/core
|
|
33
|
-
```
|
|
32
|
+
<InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-ai-sdk", "ai", "@ai-sdk/react", "@langchain/core"]} />
|
|
34
33
|
|
|
35
34
|
</Step>
|
|
36
35
|
<Step>
|
|
@@ -4,6 +4,7 @@ title: Full-Stack Integration
|
|
|
4
4
|
|
|
5
5
|
import { Step, Steps } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
8
|
|
|
8
9
|
Integrate Mastra directly into your Next.js application's API routes. This approach keeps your backend and frontend code within the same project.
|
|
9
10
|
|
|
@@ -65,9 +66,7 @@ This default route uses the Vercel AI SDK directly with OpenAI. In the following
|
|
|
65
66
|
|
|
66
67
|
Add the `@mastra/core` package and its peer dependency `zod` (which you can use later inside tools for example). Also add `@mastra/ai-sdk` to convert Mastra's stream to an AI SDK-compatible format:
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
npm install @mastra/core@latest @mastra/ai-sdk@latest zod@latest
|
|
70
|
-
```
|
|
69
|
+
<InstallCommand npm={["@mastra/core@latest", "@mastra/ai-sdk@latest", "zod@latest"]} />
|
|
71
70
|
|
|
72
71
|
</Step>
|
|
73
72
|
<Step>
|
|
@@ -4,6 +4,7 @@ title: Separate Server Integration
|
|
|
4
4
|
|
|
5
5
|
import { Step, Steps } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
8
|
|
|
8
9
|
Run Mastra as a standalone server and connect your Next.js frontend (using assistant-ui) to its API endpoints. This approach separates your AI backend from your frontend application, allowing for independent development and scaling.
|
|
9
10
|
|
|
@@ -31,9 +32,7 @@ cd your-mastra-server-directory # Replace with the actual directory name
|
|
|
31
32
|
|
|
32
33
|
In the next steps you'll need to use the `@mastra/ai-sdk` package. Add it to your Mastra project:
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
npm install @mastra/ai-sdk@latest
|
|
36
|
-
```
|
|
35
|
+
<InstallCommand npm={["@mastra/ai-sdk@latest"]} />
|
|
37
36
|
|
|
38
37
|
You now have a basic Mastra server project ready.
|
|
39
38
|
|
|
@@ -3,8 +3,8 @@ title: AssistantModal
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import {
|
|
7
|
-
import { AssistantModalSample } from "
|
|
6
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
|
+
import { AssistantModalSample } from "@/components/samples/assistant-modal-sample";
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
@@ -20,29 +20,7 @@ A chat bubble shown in the bottom right corner of the screen. Useful for support
|
|
|
20
20
|
|
|
21
21
|
### Add `assistant-modal`
|
|
22
22
|
|
|
23
|
-
<
|
|
24
|
-
<Tab>
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npx assistant-ui@latest add assistant-modal
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
</Tab>
|
|
31
|
-
<Tab>
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
npx shadcn@latest add @assistant-ui/assistant-modal
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</Tab>
|
|
38
|
-
<Tab>
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
npx shadcn@latest add "https://r.assistant-ui.com/assistant-modal"
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
</Tab>
|
|
45
|
-
</Tabs>
|
|
23
|
+
<InstallCommand shadcn={["assistant-modal"]} />
|
|
46
24
|
|
|
47
25
|
This adds `/components/assistant-ui/assistant-modal.tsx` to your project, which you can adjust as needed.
|
|
48
26
|
|
|
@@ -3,7 +3,7 @@ title: AssistantSidebar
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import {
|
|
6
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
@@ -16,29 +16,7 @@ A chat sidebar show on the right side of the screen. Useful for co-pilot use cas
|
|
|
16
16
|
|
|
17
17
|
### Add `assistant-sidebar`
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
<Tab>
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
npx assistant-ui@latest add assistant-sidebar
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
</Tab>
|
|
27
|
-
<Tab>
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npx shadcn@latest add @assistant-ui/assistant-sidebar
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</Tab>
|
|
34
|
-
<Tab>
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
npx shadcn@latest add "https://r.assistant-ui.com/assistant-sidebar"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
</Tab>
|
|
41
|
-
</Tabs>
|
|
19
|
+
<InstallCommand shadcn={["assistant-sidebar"]} />
|
|
42
20
|
|
|
43
21
|
This adds `/components/assistant-ui/assistant-sidebar.tsx` to your project, which you can adjust as needed.
|
|
44
22
|
|
|
@@ -3,9 +3,9 @@ title: Attachment
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import { AttachmentSample } from "
|
|
6
|
+
import { AttachmentSample } from "@/components/samples/attachment-sample";
|
|
7
7
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
8
|
-
import {
|
|
8
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
9
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
@@ -27,29 +27,7 @@ The Attachment components let the user attach files and view the attachments.
|
|
|
27
27
|
|
|
28
28
|
### Add `attachment`
|
|
29
29
|
|
|
30
|
-
<
|
|
31
|
-
<Tab>
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
npx assistant-ui@latest add attachment
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</Tab>
|
|
38
|
-
<Tab>
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
npx shadcn@latest add @assistant-ui/attachment
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
</Tab>
|
|
45
|
-
<Tab>
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
npx shadcn@latest add "https://r.assistant-ui.com/attachment"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
</Tab>
|
|
52
|
-
</Tabs>
|
|
30
|
+
<InstallCommand shadcn={["attachment"]} />
|
|
53
31
|
|
|
54
32
|
This adds a `/components/assistant-ui/attachment.tsx` file to your project, which you can adjust as needed.
|
|
55
33
|
|
|
@@ -6,7 +6,7 @@ Allow the assistant to display rich text using markdown.
|
|
|
6
6
|
|
|
7
7
|
import { Step, Steps } from "fumadocs-ui/components/steps";
|
|
8
8
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
9
|
-
import {
|
|
9
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
10
10
|
|
|
11
11
|
<Callout>
|
|
12
12
|
Markdown support is already included by default in the `Thread` component.
|
|
@@ -19,29 +19,7 @@ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
|
|
|
19
19
|
<Step>
|
|
20
20
|
### Add `markdown-text`
|
|
21
21
|
|
|
22
|
-
<
|
|
23
|
-
<Tab>
|
|
24
|
-
|
|
25
|
-
```sh
|
|
26
|
-
npx assistant-ui@latest add markdown-text
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
</Tab>
|
|
30
|
-
<Tab>
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
npx shadcn@latest add @assistant-ui/markdown-text
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
</Tab>
|
|
37
|
-
<Tab>
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npx shadcn@latest add "https://r.assistant-ui.com/markdown-text"
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
</Tab>
|
|
44
|
-
</Tabs>
|
|
22
|
+
<InstallCommand shadcn={["markdown-text"]} />
|
|
45
23
|
|
|
46
24
|
This adds a `/components/assistant-ui/markdown-text.tsx` file to your project, which you can adjust as needed.
|
|
47
25
|
|
|
@@ -4,7 +4,7 @@ title: "Mermaid Diagrams"
|
|
|
4
4
|
|
|
5
5
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
6
6
|
import { Step, Steps } from "fumadocs-ui/components/steps";
|
|
7
|
-
import {
|
|
7
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
8
8
|
|
|
9
9
|
Render Mermaid diagrams in chat messages with the `mermaid-diagram` component.
|
|
10
10
|
|
|
@@ -13,29 +13,7 @@ Render Mermaid diagrams in chat messages with the `mermaid-diagram` component.
|
|
|
13
13
|
|
|
14
14
|
### Add `mermaid-diagram` component
|
|
15
15
|
|
|
16
|
-
<
|
|
17
|
-
<Tab>
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
npx assistant-ui@latest add mermaid-diagram
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
</Tab>
|
|
24
|
-
<Tab>
|
|
25
|
-
|
|
26
|
-
```sh
|
|
27
|
-
npx shadcn@latest add @assistant-ui/mermaid-diagram
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
</Tab>
|
|
31
|
-
<Tab>
|
|
32
|
-
|
|
33
|
-
```sh
|
|
34
|
-
npx shadcn@latest add "https://r.assistant-ui.com/mermaid-diagram"
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
</Tab>
|
|
38
|
-
</Tabs>
|
|
16
|
+
<InstallCommand shadcn={["mermaid-diagram"]} />
|
|
39
17
|
|
|
40
18
|
This will install the required dependencies and add the component to your project.
|
|
41
19
|
|
|
@@ -3,7 +3,7 @@ title: Reasoning
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
|
-
import {
|
|
6
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
@@ -16,29 +16,7 @@ The Reasoning component displays AI reasoning or thinking messages in a collapsi
|
|
|
16
16
|
|
|
17
17
|
### Add `reasoning`
|
|
18
18
|
|
|
19
|
-
<
|
|
20
|
-
<Tab>
|
|
21
|
-
|
|
22
|
-
```sh
|
|
23
|
-
npx assistant-ui@latest add reasoning
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
</Tab>
|
|
27
|
-
<Tab>
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npx shadcn@latest add @assistant-ui/reasoning
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</Tab>
|
|
34
|
-
<Tab>
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
npx shadcn@latest add "https://r.assistant-ui.com/reasoning"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
</Tab>
|
|
41
|
-
</Tabs>
|
|
19
|
+
<InstallCommand shadcn={["reasoning"]} />
|
|
42
20
|
|
|
43
21
|
This adds a `/components/assistant-ui/reasoning.tsx` file to your project, which you can adjust as needed.
|
|
44
22
|
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
title: Custom Scrollbar
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
6
|
+
|
|
5
7
|
If you want to show a custom scrollbar UI of the Thread.Viewport in place of the system default, you can integrate `@radix-ui/react-scroll-area`.
|
|
6
8
|
An example implementation of this is [shadcn/ui's Scroll Area](https://ui.shadcn.com/docs/components/scroll-area).
|
|
7
9
|
|
|
8
10
|
## Add shadcn Scroll Area
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
npx shadcn@latest add scroll-area
|
|
12
|
-
```
|
|
12
|
+
<InstallCommand shadcn={["scroll-area"]} />
|
|
13
13
|
|
|
14
14
|
### @radix-ui/react-scroll-area v1.2.0 release candidate required
|
|
15
15
|
|
|
16
16
|
The v1.2.0-rc.x release candidate can be installed via
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
pnpm add @radix-ui/react-scroll-area@next
|
|
20
|
-
```
|
|
18
|
+
<InstallCommand npm={["@radix-ui/react-scroll-area@next"]} />
|
|
21
19
|
|
|
22
20
|
## Additional Styles
|
|
23
21
|
|
|
@@ -5,7 +5,7 @@ title: Syntax Highlighting
|
|
|
5
5
|
import { Steps, Step } from "fumadocs-ui/components/steps";
|
|
6
6
|
import { Callout } from "fumadocs-ui/components/callout";
|
|
7
7
|
import { TypeTable } from "fumadocs-ui/components/type-table";
|
|
8
|
-
import {
|
|
8
|
+
import { InstallCommand } from "@/components/docs/install-command";
|
|
9
9
|
|
|
10
10
|
Syntax highlighting for code blocks in markdown.
|
|
11
11
|
|
|
@@ -26,29 +26,7 @@ Syntax highlighting for code blocks in markdown.
|
|
|
26
26
|
|
|
27
27
|
#### Add `shiki-highlighter`
|
|
28
28
|
|
|
29
|
-
<
|
|
30
|
-
<Tab>
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
npx assistant-ui@latest add shiki-highlighter
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
</Tab>
|
|
37
|
-
<Tab>
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npx shadcn@latest add @assistant-ui/shiki-highlighter
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
</Tab>
|
|
44
|
-
<Tab>
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
npx shadcn@latest add "https://r.assistant-ui.com/shiki-highlighter"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
</Tab>
|
|
51
|
-
</Tabs>
|
|
29
|
+
<InstallCommand shadcn={["shiki-highlighter"]} />
|
|
52
30
|
|
|
53
31
|
This adds a `/components/assistant-ui/shiki-highlighter.tsx` file to your project and
|
|
54
32
|
installs the `react-shiki` dependency. The highlighter can be customized by editing
|
|
@@ -237,29 +215,7 @@ For more information, see [Shiki's documentation on dual and multi themes](https
|
|
|
237
215
|
|
|
238
216
|
#### Add `syntax-highlighter`
|
|
239
217
|
|
|
240
|
-
<
|
|
241
|
-
<Tab>
|
|
242
|
-
|
|
243
|
-
```sh
|
|
244
|
-
npx assistant-ui@latest add syntax-highlighter
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
</Tab>
|
|
248
|
-
<Tab>
|
|
249
|
-
|
|
250
|
-
```sh
|
|
251
|
-
npx shadcn@latest add @assistant-ui/syntax-highlighter
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
</Tab>
|
|
255
|
-
<Tab>
|
|
256
|
-
|
|
257
|
-
```sh
|
|
258
|
-
npx shadcn@latest add "https://r.assistant-ui.com/syntax-highlighter"
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
</Tab>
|
|
262
|
-
</Tabs>
|
|
218
|
+
<InstallCommand shadcn={["syntax-highlighter"]} />
|
|
263
219
|
|
|
264
220
|
Adds a `/components/assistant-ui/syntax-highlighter.tsx` file to your project and installs the `react-syntax-highlighter` dependency.
|
|
265
221
|
|