paste detecte new
This commit is contained in:
@@ -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")
|
||||||
|
|||||||
Reference in New Issue
Block a user