ai-api-test / main.py
Rupnil's picture
Update main.py
f335863
raw
history blame
435 Bytes
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/<string:query>')
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}"}'