Components
Client Only
Installation
pnpm dlx @docyrus/cli add @docyrus/ui-editor-agentRequired Packages(3 packages)
pnpm add @ai-sdk/react ai zodUI Primitives(1 component)
npx shadcn@latest add buttonUsage
import {
type EditorAgentClient,
type EditorAgentProps,
type EditorAgentUser,
type IEditorAgentClientTool,
EditorAgent
} from "@docyrus/ui/components/editor-agent";
<type EditorAgentClient
agentId="..."
open
onClose={() => {}}
client={...}
user={...}
apiBaseUrl="..."
getAccessToken={() => {}}
width={DEFAULT_WIDTH_PX}
acceptFileTypes="DEFAULT_ACCEPT_FILE_TYPES"
allowAttachments={true}
dataSourceId={...}
extraBody={() => {}}
clientTools={ReadonlyIEditorAgentClientTool[]}
editorContext={() => {}}
senderNameFallback="Editor"
/>API Reference
| Prop | Type | Default |
|---|---|---|
agentId | string | — |
open | boolean | — |
onClose | () => void | — |
client | EditorAgentClient | null | undefined | — |
user | EditorAgentUser | null | — |
apiBaseUrl | string | — |
getAccessToken | () => string | null | Promise<string | null> | — |
width | number | DEFAULT_WIDTH_PX |
acceptFileTypes | string | DEFAULT_ACCEPT_FILE_TYPES |
allowAttachments | boolean | true |
dataSourceId | string | null | — |
extraBody | () => Record<string, unknown> | null | undefined | — |
clientTools | ReadonlyArray<IEditorAgentClientTool> | — |
editorContext | () => string | null | undefined | — |
senderNameFallback | string | 'Editor' |
className | string | — |
Components
| Component | Description |
|---|---|
type EditorAgentClient | Public export |
type EditorAgentProps | Public export |
type EditorAgentUser | Public export |
type IEditorAgentClientTool | Public export |
EditorAgent | Public export |
CodyAgentToggle | Internal — cody-agent-toggle.tsx |