fix wrong status code on openai streaming

This commit is contained in:
Cyberes 2023-10-11 18:17:02 -06:00
parent 74cf8f309b
commit 4e3985e156
2 changed files with 4 additions and 6 deletions

View File

@ -65,7 +65,6 @@ def openai_chat_completions(model_name=None):
return 'Invalid prompt', 400
event_id = None
response_status_code = 0
start_time = time.time()
request_valid, invalid_response = handler.validate_request()
@ -91,7 +90,7 @@ def openai_chat_completions(model_name=None):
None,
handler.parameters,
request.headers,
response_status_code,
429,
request.url,
handler.backend_url,
)
@ -159,7 +158,7 @@ def openai_chat_completions(model_name=None):
elapsed_time,
handler.parameters,
r_headers,
response_status_code,
200,
r_url,
handler.backend_url,
)

View File

@ -90,7 +90,6 @@ def openai_completions(model_name=None):
return 'DISABLED', 401
event_id = None
response_status_code = 0
start_time = time.time()
request_valid, invalid_response = handler.validate_request()
@ -117,7 +116,7 @@ def openai_completions(model_name=None):
None,
handler.parameters,
request.headers,
response_status_code,
429,
request.url,
handler.backend_url,
)
@ -185,7 +184,7 @@ def openai_completions(model_name=None):
elapsed_time,
handler.parameters,
r_headers,
response_status_code,
200,
r_url,
handler.backend_url,
)