fix: 机器人收到重复图片时也回复OCR识别结果给用户
This commit is contained in:
@@ -283,10 +283,12 @@ class WeComBotService:
|
||||
|
||||
if status == "duplicate":
|
||||
dup_id = result.get("duplicate_of", "?")
|
||||
ocr_text = result.get("ocr_text", "")
|
||||
preview = ocr_text[:200].replace("\n", " ") if ocr_text else "无识别内容"
|
||||
await self.ws_client.reply_stream(
|
||||
frame,
|
||||
stream_id,
|
||||
f"该图片内容已存在于知识库中(ID: {dup_id}),无需重复录入。",
|
||||
f"🔄 该图片内容已存在于知识库中(ID: {dup_id}),无需重复录入。\n\n识别内容:\n{preview}{'...' if len(ocr_text) > 200 else ''}",
|
||||
True,
|
||||
)
|
||||
elif status == "completed":
|
||||
|
||||
Reference in New Issue
Block a user