3 Commits

Author SHA1 Message Date
0cf1896b5b paste detecte new 2025-11-05 19:00:02 +08:00
a45e5f6f37 Merge branch 'main' into czh 2025-10-29 20:18:12 +08:00
6c38e9067d change namespace 2025-10-29 20:17:40 +08:00
2 changed files with 9 additions and 4 deletions

View File

@@ -57,9 +57,14 @@ def realtime_response(config: dict, realtime_action: dict) -> None:
# emit('paste_detected', paste_data) # emit('paste_detected', paste_data)
#判断一下,如果粘帖内容过多就发送,后期可加入更多条件判断 #判断一下,如果粘帖内容过多就发送,后期可加入更多条件判断
if bb.pasted_content and len(bb.pasted_content) > 250: if bb.pasted_content and len(bb.pasted_content) > 200:
chatmanager.ase_client.send("pasted_detected_in", {"file_path": file_path, "content": bb.pasted_content}) 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": elif rtype == "fileEdit":
file_path = realtime_action.get("filePath") file_path = realtime_action.get("filePath")

View File

@@ -28,4 +28,4 @@ region = ap-guangzhou
[ASE_ENGINE] [ASE_ENGINE]
url = https://asengine.net url = https://asengine.net
namespace = /socket.io/c159a41d238b00f35ff33e036d007a0dec4d03197084b5557949a2f7f5ffce03 namespace = /socket.io/7100eebf7a909e1ee3f4e06766f512f0358ecb6ac51d5434c17d31dd70890dc1