File size: 505 Bytes
68cb93e
 
 
6d1753b
68cb93e
 
 
 
 
 
 
 
 
 
 
 
 
1c305af
68cb93e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Flask 應用程式碼
from flask import Flask, render_template, request, jsonify
from trueGPT import get_response

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('index.html')

@app.route('/get_response', methods=['POST'])
def process_input():
    user_input = request.json['user_input']
    response = get_response(user_input)
    return jsonify(response=response)

if __name__ == '__main__':
    get_response("preheat")
    app.run(host='0.0.0.0',port=7860, debug=True)