Update api/utils.py
Browse files- api/utils.py +3 -3
api/utils.py
CHANGED
@@ -121,7 +121,7 @@ async def process_streaming_response(request: ChatRequest):
|
|
121 |
content = line + "\n"
|
122 |
if "https://www.blackbox.ai" in content:
|
123 |
validate.getHid(True)
|
124 |
-
content = "
|
125 |
logger.info(f"hid refreshed due to content: {content}")
|
126 |
yield f"data: {json.dumps(create_chat_completion_data(content, request.model, timestamp))}\n\n"
|
127 |
break
|
@@ -188,8 +188,8 @@ async def process_non_streaming_response(request: ChatRequest):
|
|
188 |
|
189 |
if "https://www.blackbox.ai" in full_response:
|
190 |
validate.getHid(True)
|
191 |
-
full_response = "
|
192 |
-
logger.info("
|
193 |
|
194 |
if full_response.startswith("$@$v=undefined-rv1$@$"):
|
195 |
full_response = full_response[21:]
|
|
|
121 |
content = line + "\n"
|
122 |
if "https://www.blackbox.ai" in content:
|
123 |
validate.getHid(True)
|
124 |
+
content = "The HID has been refreshed; please try again.\n"
|
125 |
logger.info(f"hid refreshed due to content: {content}")
|
126 |
yield f"data: {json.dumps(create_chat_completion_data(content, request.model, timestamp))}\n\n"
|
127 |
break
|
|
|
188 |
|
189 |
if "https://www.blackbox.ai" in full_response:
|
190 |
validate.getHid(True)
|
191 |
+
full_response = "The HID has been refreshed; please try again."
|
192 |
+
logger.info("HID refreshed due to the content of the response.")
|
193 |
|
194 |
if full_response.startswith("$@$v=undefined-rv1$@$"):
|
195 |
full_response = full_response[21:]
|