The TextMessagePartProvider provides data and APIs for TextMessagePart components.
This is useful if you want to reuse the same Text component outside of a message text, e.g. with the @assistant-ui/react-markdown package.
import { TextMessagePartProvider } from "@assistant-ui/react";
const MyApp = () => {
return (
<TextMessagePartProvider text={"Hello!"}>
<MyMarkdownText />
</TextMessagePartProvider>
);
};
Properties#
<ParametersTable
type="TextMessagePartProviderProps"
parameters={[
{
name: "text",
type: "string",
required: true,
description: "The text content to provide to child components.",
},
{
name: "isRunning",
type: "boolean",
required: false,
description: "Whether the text is still being streamed. Defaults to false.",
},
]}
/>