diff --git a/py/api.py b/py/api.py index 52fe922..e152cdc 100644 --- a/py/api.py +++ b/py/api.py @@ -99,14 +99,14 @@ class API: @self.app.route('/interstellar_ai/api/voice_recognition', methods=['POST']) def voice_recognition(): - recognition_type = request.args.get('type') + type = request.args.get('type') audio = request.args.get('audio') option = request.args.get('option') - if recognition_type == "basic": + if type == "basic": text = self.voice.basic_recognition(audio, option) return jsonify({'status': 200, 'response': text}) - - return jsonify({'status': 401, 'response': "Invalid type"}) + else: + return jsonify({'status': 401, 'response': "Invalid type"}) @self.app.route('/interstellar_ai/api/weather', methods=['POST']) def get_weather():