Update app.py
Browse files
app.py
CHANGED
@@ -215,7 +215,7 @@ def format_messages_for_deepsider(messages: List[ChatMessage]) -> str:
|
|
215 |
next_code = False
|
216 |
continue
|
217 |
|
218 |
-
if msg.role == 'assistant' and '验证码提示' in msg.content and 'clId' in msg.content:
|
219 |
next_code = True
|
220 |
continue
|
221 |
|
@@ -343,7 +343,7 @@ async def stream_openai_response(response, request_id: str, model: str, token: s
|
|
343 |
]
|
344 |
}
|
345 |
|
346 |
-
if '验证码提示' in content:
|
347 |
codeFlag = True
|
348 |
yield f"data: {json.dumps(chunk)}\n\n"
|
349 |
|
@@ -464,7 +464,7 @@ async def create_chat_completion(
|
|
464 |
|
465 |
if len(chat_request.messages) > 1:
|
466 |
msg = chat_request.messages[-2]
|
467 |
-
if msg.role == 'assistant' and
|
468 |
isCode = True
|
469 |
clId = re.search(r'\[clId:(.*)]', msg.content).group(1)
|
470 |
|
|
|
215 |
next_code = False
|
216 |
continue
|
217 |
|
218 |
+
if msg.role == 'assistant' and ('验证码提示' in msg.content or '验证码已发送至您的邮箱' in msg.content) and 'clId' in msg.content:
|
219 |
next_code = True
|
220 |
continue
|
221 |
|
|
|
343 |
]
|
344 |
}
|
345 |
|
346 |
+
if '验证码提示' in content or '验证码已发送至您的邮箱' in content:
|
347 |
codeFlag = True
|
348 |
yield f"data: {json.dumps(chunk)}\n\n"
|
349 |
|
|
|
464 |
|
465 |
if len(chat_request.messages) > 1:
|
466 |
msg = chat_request.messages[-2]
|
467 |
+
if msg.role == 'assistant' and ('验证码提示' in msg.content or '验证码已发送至您的邮箱' in msg.content) and 'clId' in msg.content:
|
468 |
isCode = True
|
469 |
clId = re.search(r'\[clId:(.*)]', msg.content).group(1)
|
470 |
|