OptionalbodyExtra body fields sent with every message
OptionalheadersExtra headers sent with every request
OptionalidChat/session ID. Auto-generated if not provided. Persisted in localStorage if persistSession is true.
OptionalinitialInitial messages to display before loading from server
OptionalloadLoad chat history from server on mount (default: true)
OptionalonCalled on error
OptionalonCalled when the assistant finishes responding
OptionalonCalled when a tool call is received (for client-side tool rendering)
Options for the useChat hook