map finish reason

This commit is contained in:
Krrish Dholakia 2023-09-13 19:22:38 -07:00
parent 1b346e0139
commit aaa57abddd
10 changed files with 64 additions and 56 deletions

View file

@ -529,6 +529,8 @@ def completion(
completion_tokens = len(encoding.encode(completion_response))
## RESPONSE OBJECT
model_response["choices"][0]["message"]["content"] = completion_response
if response[0].finish_reason:
model_response.choices[0].finish_reason = response[0].finish_reason
model_response["created"] = time.time()
model_response["model"] = model
model_response["usage"] = {