diff --git a/.changeset/selfish-snakes-drive.md b/.changeset/selfish-snakes-drive.md new file mode 100644 index 000000000..6229acbb3 --- /dev/null +++ b/.changeset/selfish-snakes-drive.md @@ -0,0 +1,5 @@ +--- +"@assistant-ui/react": patch +--- + +feat: MessageRuntime.unstable_getCopyText API diff --git a/packages/react/src/runtimes/speech/SpeechAdapterTypes.ts b/packages/react/src/runtimes/speech/SpeechAdapterTypes.ts index 93c01e487..5f8492541 100644 --- a/packages/react/src/runtimes/speech/SpeechAdapterTypes.ts +++ b/packages/react/src/runtimes/speech/SpeechAdapterTypes.ts @@ -1,4 +1,4 @@ -import { ThreadMessage, Unsubscribe } from "../../types"; +import { Unsubscribe } from "../../types"; export namespace SpeechSynthesisAdapter { export type Status = @@ -19,7 +19,7 @@ export namespace SpeechSynthesisAdapter { } export type SpeechSynthesisAdapter = { - speak: (message: ThreadMessage) => SpeechSynthesisAdapter.Utterance; + speak: (text: string) => SpeechSynthesisAdapter.Utterance; }; export namespace SpeechRecognitionAdapter { diff --git a/packages/react/src/runtimes/speech/WebSpeechSynthesisAdapter.ts b/packages/react/src/runtimes/speech/WebSpeechSynthesisAdapter.ts index e6fb9870c..065660f6e 100644 --- a/packages/react/src/runtimes/speech/WebSpeechSynthesisAdapter.ts +++ b/packages/react/src/runtimes/speech/WebSpeechSynthesisAdapter.ts @@ -1,10 +1,7 @@ -import { ThreadMessage } from "../../types"; -import { getThreadMessageText } from "../../utils/getThreadMessageText"; import { SpeechSynthesisAdapter } from "./SpeechAdapterTypes"; export class WebSpeechSynthesisAdapter implements SpeechSynthesisAdapter { - speak(message: ThreadMessage): SpeechSynthesisAdapter.Utterance { - const text = getThreadMessageText(message); + speak(text: string): SpeechSynthesisAdapter.Utterance { const utterance = new SpeechSynthesisUtterance(text); const subscribers = new Set<() => void>();