Implement AI workspace and mitigation workflow
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import asyncio
|
||||
import random
|
||||
|
||||
async def natural_send_message(text,
|
||||
send,
|
||||
start_typing,
|
||||
stop_typing,
|
||||
skip_thinking=False
|
||||
):
|
||||
|
||||
async def natural_send_message(
|
||||
text, send, start_typing, stop_typing, skip_thinking=False
|
||||
):
|
||||
"""
|
||||
Parses and sends messages with natural delays based on message length.
|
||||
|
||||
@@ -41,7 +39,9 @@ async def natural_send_message(text,
|
||||
# Decide when to start thinking *before* typing
|
||||
if not skip_thinking:
|
||||
if natural_delay > 3.5: # Only delay if response is long
|
||||
await asyncio.sleep(natural_delay - 3.5) # "Thinking" pause before typing
|
||||
await asyncio.sleep(
|
||||
natural_delay - 3.5
|
||||
) # "Thinking" pause before typing
|
||||
|
||||
# Start typing
|
||||
await start_typing()
|
||||
@@ -55,4 +55,4 @@ async def natural_send_message(text,
|
||||
# Optional: Small buffer between messages to prevent rapid-fire responses
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
return ids
|
||||
return ids
|
||||
|
||||
Reference in New Issue
Block a user