Rupnil commited on
Commit
f335863
1 Parent(s): 666a38a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -3
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
- return '{"status": {"details": {"version": "0.1", "code": 200, "message": "working"}}}'
 
 
 
 
 
 
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}"}'