Fixed the buttons
This commit is contained in:
parent
19a9567a5d
commit
bb3db0ce1c
6 changed files with 103 additions and 164 deletions
10
py/api.py
10
py/api.py
|
@ -26,11 +26,11 @@ class API:
|
|||
def create_ai():
|
||||
access_token = secrets.token_urlsafe(self.crypt_size)
|
||||
|
||||
if access_token not in self.ai_response:
|
||||
self.ai_response[access_token] = ""
|
||||
return jsonify({'status': 200, 'access_token': access_token})
|
||||
while access_token in self.ai_response:
|
||||
access_token = secrets.token_urlsafe(self.crypt_size)
|
||||
|
||||
return jsonify({'status': 401, 'error': 'An error occurred, please try again.'})
|
||||
self.ai_response[access_token] = ""
|
||||
return jsonify({'status': 200, 'access_token': access_token})
|
||||
|
||||
@self.app.route('/interstellar_ai/api/ai_send', methods=['POST'])
|
||||
def send_ai():
|
||||
|
@ -96,7 +96,7 @@ class API:
|
|||
return jsonify({'status': 401, 'response': "Invalid action"})
|
||||
|
||||
@self.app.route('/interstellar_ai/api/voice_recognition', methods=['POST'])
|
||||
def db_manipulate():
|
||||
def voice_recognition():
|
||||
recognition_type = request.args.get('type')
|
||||
audio = request.args.get('audio_data')
|
||||
option = request.args.get('option')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue