paste detecte new

This commit is contained in:
2025-11-05 19:00:02 +08:00
parent a45e5f6f37
commit 0cf1896b5b

View File

@@ -57,9 +57,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
# emit('paste_detected', paste_data)
#判断一下,如果粘帖内容过多就发送,后期可加入更多条件判断
if bb.pasted_content and len(bb.pasted_content) > 250:
chatmanager.ase_client.send("pasted_detected_in", {"file_path": file_path, "content": bb.pasted_content})
if bb.pasted_content and len(bb.pasted_content) > 200:
print(f"粘贴内容 : {bb.pasted_content[:100]}...")
print(f"ready to send")
try:
result = chatmanager.ase_client.send_text("pasted_detected_in", bb.pasted_content)
print(f"Send result: {result}")
except Exception as e:
print(f"Error sending: {e}")
elif rtype == "fileEdit":
file_path = realtime_action.get("filePath")