csail-copilot / app.py
Hongyin Luo
add application file
db1c120
raw
history blame
381 Bytes
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)
gradio_io.launch()