const [messageState, setMessageState] = useState<{
messages: Message[];
pending?: string;
history: [string, string][];
pendingSourceDocs?: Document[];
}>({
messages: [
{
message: 'Hi, my name is Ante, ask me what you want to know!',
type: 'apiMessage',
},
],
history: [],
});
const { messages, history } = messageState;
view raw index.tsx hosted with ❤ by GitHub