How to handle user inputs in the Generative UI application.
onAction
callback will be called with the form data.
In this case, Thesys SDK will automatically fill the llmFriendlyMessage
with the form data and the action
such that
the appropriate tool call is made to the backend.
Note: If you are building a chatbot, this is already handled for you in the <C1Chat>
component.
updateMessage
callback will be called with the updated form data merged with
the rest of the response object. Simply pass in a function to the updateMessage
prop that can be used to persist the
entire reponse and form persistence should be handled automatically.