Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| def echo(message, history): | |
| print(history) | |
| # [] | |
| # [{'role': 'user', 'metadata': None, 'content': '1', 'options': None}, {'role': 'assistant', 'metadata': None, 'content': 'you typed: 1', 'options': None}] | |
| # [{'role': 'user', 'metadata': None, 'content': '1', 'options': None}, {'role': 'assistant', 'metadata': None, 'content': 'you typed: 1', 'options': None}, {'role': 'user', 'metadata': None, 'content': '2', 'options': None}, {'role': 'assistant', 'metadata': None, 'content': 'you typed: 2', 'options': None}] | |
| return f"you typed: {message}" | |
| demo = gr.ChatInterface( | |
| fn=echo, | |
| type="messages", | |
| autofocus=True, | |
| title="Chatbot", | |
| description="aaaa" | |
| ) | |
| demo.launch() |