mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
* first commit * Add code * Tests + code * lint * Add code * notebook * add changeset * type * Add client test * type * Add code * Chatbot type * Add code * test chatbot * fix e2e test * js tests * Consolidate Error and Tool message. Allow Messages in postprocess * Rename to messages * fix tests * notebook clean * More tests and messages * add changeset * notebook * client test * Fix issues * Chatbot docs * add changeset * Add image * Add img tag * Address comments * Add code * Revert chatinterface streaming change. Use title in metadata. Address pngwn comments * Add code * changelog highlight --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
16 lines
280 B
Python
16 lines
280 B
Python
import time
|
|
import gradio as gr
|
|
|
|
|
|
def slow_echo(message, history):
|
|
for i in range(len(message)):
|
|
time.sleep(0.05)
|
|
yield "You typed: " + message[: i + 1]
|
|
|
|
|
|
|
|
demo = gr.ChatInterface(slow_echo, msg_format="messages")
|
|
|
|
if __name__ == "__main__":
|
|
demo.launch()
|