Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(assistant): add AssistantUiChat component

Steven Enamakel6360e0d63f48
diff --git a/app/src/features/conversations/components/AssistantUiChat.tsx b/app/src/features/conversations/components/AssistantUiChat.tsx
new file mode 100644
index 0000000000..5267ac3a61
--- /dev/null
+++ b/app/src/features/conversations/components/AssistantUiChat.tsx
@@ -0,0 +1,41 @@
+import {
+ AssistantRuntimeProvider,
+ type ChatModelAdapter,
+ CompositeAttachmentAdapter,
+ SimpleImageAttachmentAdapter,
+ SimpleTextAttachmentAdapter,
+ useLocalRuntime,
+} from '@assistant-ui/react';
+
+import { Thread } from '@/components/assistant-ui/thread';
+
+const localChatModel: ChatModelAdapter = {
+ run: async () => ({
+ content: [
+ {
+ type: 'text',
+ text: 'This is a local placeholder response. OpenHuman connectors are not wired in yet.',
+ },
+ ],
+ }),
+};
+
+const localAttachmentAdapter = new CompositeAttachmentAdapter([
+ new SimpleImageAttachmentAdapter(),
+ new SimpleTextAttachmentAdapter(),
+]);
+
+/** The assistant-ui generated Thread, running against an isolated dummy runtime. */
+export function AssistantUiChat() {
+ const runtime = useLocalRuntime(localChatModel, {
+ adapters: { attachments: localAttachmentAdapter },
+ });
+
+ return (
+ <AssistantRuntimeProvider runtime={runtime}>
+ <Thread />
+ </AssistantRuntimeProvider>
+ );
+}
+
+export default AssistantUiChat;