Commit 316a084747ec
Changed files (1)
modules
xmpp-research-bot
modules/xmpp-research-bot/bot.py
@@ -32,6 +32,10 @@ class ResearchBot(slixmpp.ClientXMPP):
# Initialize Vertex AI client (uses Application Default Credentials)
self.client = AnthropicVertex(project_id=project_id, region=region)
+ # Register plugins
+ self.register_plugin('xep_0030') # Service Discovery
+ self.register_plugin('xep_0199') # XMPP Ping
+
# Register event handlers
self.add_event_handler("session_start", self.on_session_start)
self.add_event_handler("message", self.on_message)
@@ -190,11 +194,14 @@ async def main():
log.info("Connecting to XMPP server...")
bot.connect()
+ # Process events
try:
- await bot.process(forever=True)
+ while True:
+ await asyncio.sleep(1)
except KeyboardInterrupt:
log.info("Shutting down...")
bot.disconnect()
+ await bot.disconnected
if __name__ == "__main__":