-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (21 loc) · 685 Bytes
/
Copy pathapp.py
File metadata and controls
30 lines (21 loc) · 685 Bytes
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
from flask import Flask, render_template, request, jsonify
from glacier import ice_break
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/process", methods=["POST"])
def process():
name = request.form["name"]
person_info, profile_pic_url = ice_break(name=name)
return jsonify(
{
"summary": person_info.summary,
"interests": person_info.topics_of_interest,
"facts": person_info.facts,
"ice_breakers": person_info.ice_breakers,
"picture_url": profile_pic_url,
}
)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)