File size: 381 Bytes
db1c120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()