File size: 477 Bytes
68cb93e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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__':
    app.run(host='0.0.0.0',port=7860, debug=True)