forked from React-Group/interstellar_ai
Uhmm fixed
This commit is contained in:
parent
c1d1bf246c
commit
7010be84ea
5 changed files with 40 additions and 13 deletions
13
py/api.py
13
py/api.py
|
@ -42,19 +42,22 @@ class API:
|
|||
return jsonify({'status': 200})
|
||||
elif model_type == "mistral":
|
||||
api_key = data.get('api_key')
|
||||
thread = threading.Thread(target=self.ai.process_mistralai, args=(ai_model, messages, self, access_token, api_key))
|
||||
thread = threading.Thread(target=self.ai.process_mistralai,
|
||||
args=(ai_model, messages, self, access_token, api_key))
|
||||
thread.start()
|
||||
thread.join()
|
||||
return jsonify({'status': 200})
|
||||
elif model_type == "openai":
|
||||
api_key = data.get('api_key')
|
||||
thread = threading.Thread(target=self.ai.process_openai, args=(ai_model, messages, self, access_token, api_key))
|
||||
thread = threading.Thread(target=self.ai.process_openai,
|
||||
args=(ai_model, messages, self, access_token, api_key))
|
||||
thread.start()
|
||||
thread.join()
|
||||
return jsonify({'status': 200})
|
||||
elif model_type == "anthropic":
|
||||
api_key = data.get('api_key')
|
||||
thread = threading.Thread(target=self.ai.process_anthropic, args=(ai_model, messages, self, access_token, api_key))
|
||||
thread = threading.Thread(target=self.ai.process_anthropic,
|
||||
args=(ai_model, messages, self, access_token, api_key))
|
||||
thread.start()
|
||||
thread.join()
|
||||
return jsonify({'status': 200})
|
||||
|
@ -118,3 +121,7 @@ class API:
|
|||
|
||||
ssl_context = ("cert.pem", "key.pem")
|
||||
self.app.run(debug=True, host='0.0.0.0', port=5000)
|
||||
|
||||
|
||||
api = API()
|
||||
api.run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue