Spaces:
Sleeping
Sleeping
jonathanjordan21
commited on
Commit
•
63e4b77
1
Parent(s):
4fb5f22
Update apis/chat_api.py
Browse files- apis/chat_api.py +6 -0
apis/chat_api.py
CHANGED
@@ -217,6 +217,12 @@ class ChatAPIApp:
|
|
217 |
return event_source_response
|
218 |
else:
|
219 |
data_response = streamer.chat_return_dict(stream_response)
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
return data_response
|
221 |
except HfApiException as e:
|
222 |
raise HTTPException(status_code=e.status_code, detail=e.detail)
|
|
|
217 |
return event_source_response
|
218 |
else:
|
219 |
data_response = streamer.chat_return_dict(stream_response)
|
220 |
+
data_response = {
|
221 |
+
"model": data_response.get('model'),
|
222 |
+
"created_at": data_response.get('created_at'),
|
223 |
+
"response": "The sky is blue because it is the color of the sky.",
|
224 |
+
"done": True if data_response.get('choices')[0].get('finish_reason') != null else False,
|
225 |
+
}
|
226 |
return data_response
|
227 |
except HfApiException as e:
|
228 |
raise HTTPException(status_code=e.status_code, detail=e.detail)
|