Unable to clear input after submit

I’m very new to both huggingface and Gradio, so forgive me if this is a trivial issue, and I’m just a fool.

I’m using a Blocks object to implement a very basic chatbot, and I’d like to essentially clear the input textbox after the user presses enter or presses the submit button.

with gr.Blocks() as test:
    outp = gr.Chatbot(label="Reply", )
    inp = gr.Textbox(label="Chat with AI")
    inp.submit(chatbot, [outp, inp], outp)
    inp.update(lambda: None, inp)
    btn = gr.Button("Submit")
    btn.click(fn=chatbot, inputs=inp, outputs=outp)

My code looks like this currently.
I simply wish to clear the input textbox after the input is submitted.

hi @alexjedi ,

You need to send an empty value back to the input textbox, just add these two lines

    btn.click(lambda x: gr.update(value=''), [],[inp])
    inp.submit(lambda x: gr.update(value=''), [],[inp])