-
Notifications
You must be signed in to change notification settings - Fork 926
/
Copy pathapp.py
35 lines (24 loc) · 757 Bytes
/
app.py
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 flask import Flask, render_template, request, jsonify
from dotenv import load_dotenv
load_dotenv()
from ice_breaker import ice_break_with
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/process", methods=["POST"])
def process():
name = request.form["name"]
summary_and_facts, interests, ice_breakers, profile_pic_url = ice_break_with(
name=name
)
return jsonify(
{
"summary_and_facts": summary_and_facts.to_dict(),
"interests": interests.to_dict(),
"ice_breakers": ice_breakers.to_dict(),
"picture_url": profile_pic_url,
}
)
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)