-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
25 lines (18 loc) · 806 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
from flask import Flask, render_template, request, jsonify
app = Flask(__name__, template_folder='templates', static_folder='static')
@app.route('/')
def index():
return render_template('index.html')
# Define a route for the homepage
@app.route('/submit', methods=['POST'])
def submit():
if request.method == 'POST':
user_query = request.form.get('query-text')
print("User Query:", user_query) # Check if user_query is received correctly
# Implement your research logic here
message = "ChatGPT output will go here: " + user_query
print("Message:", message) # Check if the message is generated correctly
# Return a JSON response with the message
return jsonify({'message': message})
if __name__ == '__main__':
app.run(debug=True)