add /v1/ endpoints binding

This commit is contained in:
jwj7140 2023-07-03 00:50:46 +09:00
parent 7dcffd7a03
commit f713dd515d

View file

@ -143,6 +143,7 @@ def make_resData_stream(data, chat=False, time_now = 0, start=False):
@app.route('/chat/completions', methods=['POST'])
@app.route('/v1/chat/completions', methods=['POST'])
def chat_completions():
if (args.api_key != "" and request.headers["Authorization"].split()[1] != args.api_key):
return Response(status=403)
@ -177,6 +178,7 @@ def chat_completions():
@app.route('/completions', methods=['POST'])
@app.route('/v1/completions', methods=['POST'])
def completion():
if (args.api_key != "" and request.headers["Authorization"].split()[1] != args.api_key):
return Response(status=403)