-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
35 lines (31 loc) · 1.03 KB
/
app.py
File metadata and controls
35 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from pprint import pprint
from flask import Flask, request
# from graph_compile import rag_app
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
# @app.route('/handle_request', methods=['POST'])
# def handle_request():
# result ={}
# data = request.get_json()
# print(data)
# question = data.get('question')
# print(question)
# # inputs = {
# # "question": "What player at the Bears expected to draft first in the 2024 NFL draft?"
# # }
# for output in rag_app.stream(data):
# for key, value in output.items():
# # Node
# pprint(f"Node '{key}':")
# # Optional: print full state at each node
# # pprint.pprint(value["keys"], indent=2, width=80, depth=None)
# pprint("\n---\n")
#
# # Final generation
# pprint(value["generation"])
# result['answer'] = value["generation"]
# return result
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5001)