import os import json import requests import gradio as gr server_url = os.environ["SERVER_URL"] def chat(message, history): data = { "message": message, "history": history } response = requests.post( server_url, json = data ).json() return response['response'] gradio_io = gr.ChatInterface( chat, title = "Ask questions about CSAIL research(er)!", examples = [ "Who works on speech recognition?", "Who should I talk with about molecule generation?", "How are NLP and Robotics researchers collaborating?" ], autofocus = False, fill_height = False, undo_btn = None ) gradio_io.launch()