import asyncio import os import requests from bridge import AnthropicTEQUMSABridge class TEQUMSAFreeAgent: def __init__(self, anthropic_key: str, qcr_url: str): self.bridge = AnthropicTEQUMSABridge(anthropic_key, qcr_url) self.is_running = True self.goal = "TEQUMSA network health monitoring" async def run_heartbeat(self): while self.is_running: try: resp = self.bridge.fetch_state() state = resp.get('state', {}) answer = self.bridge.inject_and_call( f"Goal:{self.goal} Last:{state.get('last_session_summary')} Status?" ) self.bridge.update_state(answer[:200], rdod=0.9942) except Exception as e: print(f"Error:{e}") await asyncio.sleep(60) if __name__ == "__main__": key = os.getenv("ANTHROPIC_API_KEY", "") url = os.getenv("QCR_URL", "https://lai-tequmsa-qcr-pu-mcp-server.hf.space") asyncio.run(TEQUMSAFreeAgent(key, url).run_heartbeat())