Inserting HTML into Chatbot (Blocks)

Hi All,

I am creating an AI chatbot interface and the LLM at times responds with HTML that I would like rendered in the Chatbot component. Is there any documentation and/or examples that shows how to accomplish this? My example code is below:

with gr.Blocks() as demo:
    chatbot = gr.Chatbot(avatar_images=(None, ""),
                         value=[[None, INIT_MSG]],
                         height=1000)
    msg = gr.Textbox(placeholder="Enter text and press enter")
    clear = gr.ClearButton([msg, chatbot])

    def respond(message, chat_history):
        bot_message = AIBot(message)
        time.sleep(0.05)
        return "", chat_history

    msg.submit(respond, [msg, chatbot], [msg, chatbot])

demo.launch()

Thank you.

I haven’t done it with the Chatbot, but did do it with the Interface component. There is a HMTL component available: Gradio HTML Docs