InputMessage
InputMessage is the message shape you pass into initialMessages and useChatStore().addMessage(...).
Fields
id?type: 'self' | 'other'contentrawContent?timestamp?isLoading?loadingLabel?userResponseCallback?buttons?
Usage
tsx
import type { InputMessage } from 'react-actions-chat';
const initialMessages: readonly InputMessage[] = [
{
type: 'other',
content: 'Hello! How can I help you today?',
},
];Notes
rawContentis useful when the visible transcript content is transformed, such as password maskingbuttonsattaches actions under the messageuserResponseCallbacklets the message react to the next user submission