Spaces:
Running
Running
jonathanjordan21
commited on
Update apis/chat_api.py
Browse files- apis/chat_api.py +2 -2
apis/chat_api.py
CHANGED
@@ -220,8 +220,8 @@ class ChatAPIApp:
|
|
220 |
data_response = {
|
221 |
"model": data_response.get('model'),
|
222 |
"created_at": data_response.get('created_at'),
|
223 |
-
"response":
|
224 |
-
"done": True if data_response.get('choices')[
|
225 |
}
|
226 |
return data_response
|
227 |
except HfApiException as e:
|
|
|
220 |
data_response = {
|
221 |
"model": data_response.get('model'),
|
222 |
"created_at": data_response.get('created_at'),
|
223 |
+
"response": data_response.get('choices')[-1].get('message').get('content'),
|
224 |
+
"done": True if data_response.get('choices')[-1].get('finish_reason') != null else False,
|
225 |
}
|
226 |
return data_response
|
227 |
except HfApiException as e:
|