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)