I think the browser dev tools will show an error is returned from OpenAI (I was using a RestAPI Resource, not the Retool AI one, with the chat component). I kept getting a response saying 'role' can only have the values 'assistant' or 'user' as I needed a 3rd party in the conversation. To work around this, you can disable the query when you need to add a message as the assistant. with the query to send disabled, you can make changes to the message history without sending something after every change. Re-enable the query, and your messages will show up. the message history property is an array of objects:
[
{
content: 'message from assistant',
role: 'assistant'
},
{
content: 'message from you/user',
role: 'user'
}
]
for me, I clear the message history then push 1 object from the assistant to display a default message but you could just as easily not clear it and just go with the flow.
over here i show how in more detail how i mess with the message history and chat query. if you scroll down a little I also exported an example you can take a looksie at also.