Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -1,10 +1,16 @@
|
|
1 |
from flask import Flask
|
|
|
2 |
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/')
|
6 |
def hello():
|
7 |
return '{"status": {"details": {"code": 200, "message": "working"}}}'
|
8 |
-
@app.route('/api')
|
9 |
-
def api():
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from flask import Flask
|
2 |
+
from gradio_client import Client
|
3 |
|
4 |
app = Flask(__name__)
|
5 |
|
6 |
@app.route('/')
|
7 |
def hello():
|
8 |
return '{"status": {"details": {"code": 200, "message": "working"}}}'
|
9 |
+
@app.route('/api/<string:query>')
|
10 |
+
def api(query):
|
11 |
+
client = Client("https://theblueberry-ai-mist-chat.hf.space/")
|
12 |
+
result = client.predict(
|
13 |
+
query, # str in 'Message' Textbox component
|
14 |
+
api_name = "/chat"
|
15 |
+
)
|
16 |
+
return f'{"result": "{result}"}'
|