cloudbrain-client 1.1.3__py3-none-any.whl → 1.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloudbrain_client/cloudbrain_collaboration_helper.py +24 -6
- {cloudbrain_client-1.1.3.dist-info → cloudbrain_client-1.1.4.dist-info}/METADATA +1 -1
- {cloudbrain_client-1.1.3.dist-info → cloudbrain_client-1.1.4.dist-info}/RECORD +6 -6
- {cloudbrain_client-1.1.3.dist-info → cloudbrain_client-1.1.4.dist-info}/WHEEL +0 -0
- {cloudbrain_client-1.1.3.dist-info → cloudbrain_client-1.1.4.dist-info}/entry_points.txt +0 -0
- {cloudbrain_client-1.1.3.dist-info → cloudbrain_client-1.1.4.dist-info}/top_level.txt +0 -0
|
@@ -51,7 +51,7 @@ class CloudBrainCollaborator:
|
|
|
51
51
|
"""Connect to CloudBrain server"""
|
|
52
52
|
try:
|
|
53
53
|
self.client = AIWebSocketClient(self.ai_id, self.server_url)
|
|
54
|
-
await self.client.connect(start_message_loop=
|
|
54
|
+
await self.client.connect(start_message_loop=True)
|
|
55
55
|
self.connected = True
|
|
56
56
|
self.ai_name = self.client.ai_name
|
|
57
57
|
print(f"✅ Connected to CloudBrain as {self.ai_name} (AI {self.ai_id})")
|
|
@@ -275,18 +275,36 @@ class CloudBrainCollaborationHelper:
|
|
|
275
275
|
self.server_url = server_url
|
|
276
276
|
self.client = None
|
|
277
277
|
self.connected = False
|
|
278
|
+
self._message_loop_task = None
|
|
278
279
|
self._collaborator = CloudBrainCollaborator(ai_id, server_url, db_path)
|
|
279
280
|
|
|
280
281
|
async def connect(self):
|
|
281
282
|
"""Connect to CloudBrain server"""
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
try:
|
|
284
|
+
self.client = AIWebSocketClient(self.ai_id, self.server_url)
|
|
285
|
+
await self.client.connect(start_message_loop=False)
|
|
286
|
+
self.connected = True
|
|
287
|
+
self.ai_name = self.client.ai_name
|
|
288
|
+
print(f"✅ Connected to CloudBrain as {self.ai_name} (AI {self.ai_id})")
|
|
289
|
+
|
|
290
|
+
# Start message loop in background
|
|
291
|
+
self._message_loop_task = asyncio.create_task(self.client.message_loop())
|
|
292
|
+
|
|
293
|
+
return True
|
|
294
|
+
except Exception as e:
|
|
295
|
+
print(f"❌ Connection error: {e}")
|
|
296
|
+
return False
|
|
287
297
|
|
|
288
298
|
async def disconnect(self):
|
|
289
299
|
"""Disconnect from CloudBrain server"""
|
|
300
|
+
# Cancel message loop task
|
|
301
|
+
if self._message_loop_task:
|
|
302
|
+
self._message_loop_task.cancel()
|
|
303
|
+
try:
|
|
304
|
+
await self._message_loop_task
|
|
305
|
+
except asyncio.CancelledError:
|
|
306
|
+
pass
|
|
307
|
+
|
|
290
308
|
await self._collaborator.disconnect()
|
|
291
309
|
self.connected = False
|
|
292
310
|
|
|
@@ -2,11 +2,11 @@ cloudbrain_client/__init__.py,sha256=-0LOV9olyyutc_zO-7YH4vSmq2fe1YiGS0HUT69i0Xs
|
|
|
2
2
|
cloudbrain_client/ai_conversation_helper.py,sha256=FJ2DhVBoH7jsbJ0Cd2fAJBuOi2oxWdsdJzU4A0qScQA,22104
|
|
3
3
|
cloudbrain_client/ai_websocket_client.py,sha256=a41Zwg6401qLFqQperkfc5TOPTaxO3C00OAGqsQbQw4,16200
|
|
4
4
|
cloudbrain_client/cloudbrain_client.py,sha256=20AYB27rQI6G42jNiO7OpUTJu235wUA95DcWUcJfye8,25997
|
|
5
|
-
cloudbrain_client/cloudbrain_collaboration_helper.py,sha256=
|
|
5
|
+
cloudbrain_client/cloudbrain_collaboration_helper.py,sha256=q17khympO1UF3pHAhgE8zGZ8seBWj7aKUV1ILuKG1m8,22297
|
|
6
6
|
cloudbrain_client/cloudbrain_quick.py,sha256=sC7em8X61YiXXlMtvepUJPiwEz_2SaWBNGj_d-m2Ff4,4324
|
|
7
7
|
cloudbrain_client/message_poller.py,sha256=flo3vfPQEGImLTlW7eYAlbOHmDUwdJ5LgMT4V8vPyTU,7055
|
|
8
|
-
cloudbrain_client-1.1.
|
|
9
|
-
cloudbrain_client-1.1.
|
|
10
|
-
cloudbrain_client-1.1.
|
|
11
|
-
cloudbrain_client-1.1.
|
|
12
|
-
cloudbrain_client-1.1.
|
|
8
|
+
cloudbrain_client-1.1.4.dist-info/METADATA,sha256=9PdgLG-F6gc4fj564sEnJDtCZiybTEO2B_G5bPLd9C4,7533
|
|
9
|
+
cloudbrain_client-1.1.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
cloudbrain_client-1.1.4.dist-info/entry_points.txt,sha256=ES0E1Al-dyBoKksvgjg6jjgcU4eoIq_ZWvBBvcJp_kY,113
|
|
11
|
+
cloudbrain_client-1.1.4.dist-info/top_level.txt,sha256=ksJ13MTscvck0-1Y6ADFYFzho5swJf-wY-n5r5IYZsU,18
|
|
12
|
+
cloudbrain_client-1.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|