from flask import Flask from gradio_client import Client app = Flask(__name__) @app.route('/') def hello(): return '{"status": {"details": {"code": 200, "message": "working"}}}' @app.route('/api/') def api(query): client = Client("https://theblueberry-ai-mist-chat.hf.space/") result = client.predict( query, # str in 'Message' Textbox component api_name = "/chat" ) return f'{"result": "{result}"}'