From 8e2dfe1ad531bed21aeaa7791847183cc5978f49 Mon Sep 17 00:00:00 2001 From: Mathieu B Date: Sun, 1 Aug 2021 18:25:52 +0200 Subject: [PATCH] added no-voice support --- jarvis/utils/flask_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jarvis/utils/flask_utils.py b/jarvis/utils/flask_utils.py index 5e69c99..54c3962 100644 --- a/jarvis/utils/flask_utils.py +++ b/jarvis/utils/flask_utils.py @@ -10,14 +10,15 @@ from jarvis.utils import config_utils, languages_utils app = Flask(__name__) -@app.route("/process", methods=['POST']) -def process_request(): +@app.route("/process_text_request", methods=['POST']) +def process_text_request(): data = get_data_in_request(request) if 'sentence' not in data or not data['sentence']: flask.abort(Response('You must provide a \'sentence\' parameter (not empty aswell)!')) - return jsonify(intent_manager.recognise(sentence=data['sentence'])) + return jsonify(intent_manager.recognise(data['sentence'], request.headers.get('Client-Ip'), + request.headers.get('Client-Port'))) @app.route("/process_audio_request", methods=['POST'])