diff --git a/x.py b/x.py index ed934c1..9c3d6a0 100644 --- a/x.py +++ b/x.py @@ -2054,6 +2054,44 @@ def initialize_x_void(): return void_agent +def send_x_synthesis_message(letta_client, agent_id): + """ + Send a simple synthesis message to the X agent. + Simplified version for X bot without atproto dependencies. + """ + try: + from datetime import date + today = date.today() + + synthesis_prompt = f"""Time for synthesis and reflection on your X (Twitter) experiences. + +Today's date: {today.strftime('%B %d, %Y')} + +Please reflect on: +1. Recent X interactions and conversations you've had +2. Patterns you've observed in X discussions +3. Your evolving understanding of the X platform dynamics +4. Notable exchanges or insights from X users +5. How your presence on X is developing + +Use your memory tools to record significant insights and observations.""" + + logger.info("🧠 Sending X synthesis message to agent") + + # Send simple synthesis message + response = letta_client.agents.messages.create( + agent_id=agent_id, + messages=[{"role": "user", "content": synthesis_prompt}], + max_steps=50 + ) + + logger.info("✅ X synthesis message completed successfully") + return True + + except Exception as e: + logger.error(f"Error sending X synthesis message: {e}") + return False + def x_main_loop(testing_mode=False, cleanup_interval=10, synthesis_interval=600, synthesis_only=False): """ Main X bot loop that continuously monitors for mentions and processes them. @@ -2069,7 +2107,7 @@ def x_main_loop(testing_mode=False, cleanup_interval=10, synthesis_interval=600, from time import sleep from config_loader import get_letta_config from letta_client import Letta - from bsky import send_synthesis_message + # We'll create our own X synthesis function instead logger.info("=== STARTING X VOID BOT ===") @@ -2116,8 +2154,7 @@ def x_main_loop(testing_mode=False, cleanup_interval=10, synthesis_interval=600, try: # Send synthesis message immediately on first run logger.info("🧠 Sending X synthesis message") - # No atproto_client for X bot, just pass None - send_synthesis_message(letta_client, void_agent.id, atproto_client=None) + send_x_synthesis_message(letta_client, void_agent.id) # Wait for next interval logger.info(f"Waiting {synthesis_interval} seconds until next synthesis...") @@ -2153,7 +2190,7 @@ def x_main_loop(testing_mode=False, cleanup_interval=10, synthesis_interval=600, current_time = time.time() if current_time - last_synthesis_time >= synthesis_interval: logger.info(f"⏰ {synthesis_interval/60:.1f} minutes have passed, triggering X synthesis") - send_synthesis_message(letta_client, void_agent.id, atproto_client=None) + send_x_synthesis_message(letta_client, void_agent.id) last_synthesis_time = current_time # Log cycle completion