Skip to content

Commit

Permalink
feat: allow specifying Empty component in thread-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom committed Dec 23, 2024
1 parent 1b16dce commit a2f8c20
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/purple-moose-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@assistant-ui/react": patch
---

feat: allow specifying Empty component in thread-config
1 change: 1 addition & 0 deletions packages/react/src/ui/assistant-message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const AssistantMessageContent = forwardRef<
components={{
...componentsProp,
Text: componentsProp?.Text ?? components.Text ?? ContentPart.Text,
Empty: componentsProp?.Empty ?? components.Empty,
tools: toolsComponents,
}}
/>
Expand Down
7 changes: 6 additions & 1 deletion packages/react/src/ui/thread-config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import {

import { AssistantRuntime } from "../api/AssistantRuntime";
import { AvatarProps } from "./base/avatar";
import { TextContentPartComponent, ToolCallContentPartProps } from "../types";
import {
EmptyContentPartComponent,
TextContentPartComponent,
ToolCallContentPartProps,
} from "../types";
import { AssistantRuntimeProvider } from "../context";
import { AssistantToolUI } from "../model-config";
import { useAssistantRuntime } from "../context/react/AssistantContext";
Expand Down Expand Up @@ -39,6 +43,7 @@ export type AssistantMessageConfig = {
components?:
| {
Text?: TextContentPartComponent | undefined;
Empty?: EmptyContentPartComponent | undefined;
ToolFallback?: ComponentType<ToolCallContentPartProps> | undefined;
}
| undefined;
Expand Down

0 comments on commit a2f8c20

Please sign in to comment.