File size: 440 Bytes
68a4a06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import requests


def chatbot_response(user_input: str, history) -> str:
  r = requests.post(
    "http://localhost:3000", 
    json={"example": "json"}
  )
  response = r.json()
  return f"Response from the API was {response}"
  
demo = gr.ChatInterface(fn=chatbot_response,
  title="Name of demo goes here",
  description="Description goes here")

demo.launch(server_name="localhost", server_port=4000, show_api=False)