Import
Initialize lunary
Use the `useChatMonitor` hook
useChatMonitor
hook exposes the following functions:Reconcile calls on your backend
Import and Initialize
Wrap the useChat hook
Setup the monitor on the backend
Reconcile messages with OpenAI calls
setParent
method to reconcile the frontend message IDs with the backend call:sendExtraMessageFields
on the useChat
hook so that message IDs are also sent.