multiple_users
This commit is contained in:
parent
e52091f206
commit
346cb31afd
4
main.py
4
main.py
|
@ -72,7 +72,7 @@ def init_dm():
|
||||||
user = User(username, token)
|
user = User(username, token)
|
||||||
users[username] = user
|
users[username] = user
|
||||||
threading.Thread(target=user_interest_decay, name='decayinterest_'+username).start()
|
threading.Thread(target=user_interest_decay, name='decayinterest_'+username).start()
|
||||||
message = {"assignedname": "your assigned name is " + username}
|
message = {"answer": "your assigned name is " + username, "assignedname": username}
|
||||||
return message
|
return message
|
||||||
|
|
||||||
@app.route("/api/predict", methods=['POST'])
|
@app.route("/api/predict", methods=['POST'])
|
||||||
|
@ -120,6 +120,8 @@ def predict():
|
||||||
new_state = {'modified_query': response, 'intent': state['intent']}
|
new_state = {'modified_query': response, 'intent': state['intent']}
|
||||||
dm.update(new_state)
|
dm.update(new_state)
|
||||||
reply = jsonify(message)
|
reply = jsonify(message)
|
||||||
|
dms[username] = dm
|
||||||
|
users[username] = user
|
||||||
return reply
|
return reply
|
||||||
|
|
||||||
@app.route('/api/feedback', methods = ['POST'])
|
@app.route('/api/feedback', methods = ['POST'])
|
||||||
|
|
Loading…
Reference in New Issue