refactor: simplify assistant message controls

This commit is contained in:
ajnart committed 2026-08-14 11:32:10 +02:00
1 parent 6eb75ca559
commit 0c5fc1d331
5 files changed
+310 -197

No files matched your search

@@ -13,8 +13,6 @@ import type {
} from "@assistant-ui/react";
import {
AssistantRuntimeProvider,
WebSpeechDictationAdapter,
WebSpeechSynthesisAdapter,
defineToolkit,
Tools,
useAui,
@@ -278,11 +276,6 @@ const AssistantThreadRuntime = () => {
() => createAssistantAttachmentAdapter(modelCapabilities?.imageInput !== "unsupported"),
[modelCapabilities?.imageInput],
);
const speech = useMemo(() => new WebSpeechSynthesisAdapter(), []);
const dictation = useMemo(
() => (WebSpeechDictationAdapter.isSupported() ? new WebSpeechDictationAdapter() : undefined),
[],
);
const feedback = useMemo(
() => ({
submit: ({ message, type }: { message: ThreadMessage; type: "positive" | "negative" }) => {
@@ -311,8 +304,6 @@ const AssistantThreadRuntime = () => {
adapters: {
history,
attachments,
speech,
...(dictation ? { dictation } : {}),
feedback,
},
});