AbstractIntegratedModule 0.3.6__tar.gz → 0.3.8__tar.gz
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.
- abstractintegratedmodule-0.3.8/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.cpython-310-aarch64-linux-gnu.so +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.cpython-312-x86_64-linux-gnu.so +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8/AbstractIntegratedModule.egg-info}/PKG-INFO +2 -2
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.py +191 -78
- {abstractintegratedmodule-0.3.6/AbstractIntegratedModule.egg-info → abstractintegratedmodule-0.3.8}/PKG-INFO +2 -2
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/README.md +1 -1
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/setup.py +1 -1
- abstractintegratedmodule-0.3.6/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/MANIFEST.in +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/pyproject.toml +0 -0
- {abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/setup.cfg +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AbstractIntegratedModule
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
|
|
5
5
|
Author: Micro-Novelty
|
|
6
6
|
Author-email: hernikpuspita5@gmail.com
|
|
@@ -42,7 +42,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
|
|
|
42
42
|
#### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
|
|
43
43
|
|
|
44
44
|
### Library Short Description:
|
|
45
|
-
- Development Stage: Beta, 0.3.
|
|
45
|
+
- Development Stage: Beta, 0.3.8.
|
|
46
46
|
- Maintainer: Micro-Novelty.
|
|
47
47
|
- library Source-Code is Open-sourced on github.
|
|
48
48
|
- Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
|
{abstractintegratedmodule-0.3.6 → abstractintegratedmodule-0.3.8}/AbstractIntegratedModule.py
RENAMED
|
@@ -333,8 +333,11 @@ class GeometricWeightShaping:
|
|
|
333
333
|
trB = (1/2 + mag_G) / (1.0 + trA**2)
|
|
334
334
|
trC = (1/6 + K_G) / (trB**2 - 1.0)
|
|
335
335
|
|
|
336
|
+
if np.isnan(trC) or np.isinf(trC):
|
|
337
|
+
trC = anisotropy * (1.0 - np.std(x)) + eps
|
|
338
|
+
|
|
336
339
|
floating_point = np.random.uniform(0, trC, size=X.shape)
|
|
337
|
-
return
|
|
340
|
+
return k, floating_point, structured_noise
|
|
338
341
|
|
|
339
342
|
|
|
340
343
|
def spectral_signature(self, x, structured_noise, k=5):
|
|
@@ -400,11 +403,10 @@ class GeometricWeightShaping:
|
|
|
400
403
|
anisotropy = self.anisotropy_measurement(x)
|
|
401
404
|
mag = np.mean(np.linalg.norm(x))
|
|
402
405
|
|
|
403
|
-
|
|
406
|
+
k, floating_point, structured_noise = self.eigenvalue_encoder(x)
|
|
404
407
|
AME = self.AME_Encoder(x)
|
|
405
408
|
AMR = 1.0 / (1.0 + np.exp(-AME)) # abstract modelling rate
|
|
406
|
-
|
|
407
|
-
trC = (1.0 - AMR) + eps
|
|
409
|
+
|
|
408
410
|
|
|
409
411
|
spectral_similarity = self.spectral_similarity(x, floating_point, structured_noise)
|
|
410
412
|
|
|
@@ -4753,11 +4755,19 @@ class ThreadedMessageQueue:
|
|
|
4753
4755
|
|
|
4754
4756
|
logger.info(f"[=] Threaded message queue started with {self._worker_threads} workers")
|
|
4755
4757
|
|
|
4756
|
-
def stop(self
|
|
4758
|
+
async def stop(self):
|
|
4757
4759
|
# Stop worker threads gracefully.
|
|
4758
|
-
self.
|
|
4759
|
-
|
|
4760
|
-
|
|
4760
|
+
await self.result_queue.stop()
|
|
4761
|
+
|
|
4762
|
+
# cancel and wait for all workers to exit cleanly
|
|
4763
|
+
for worker in self._workers:
|
|
4764
|
+
worker.cancel()
|
|
4765
|
+
|
|
4766
|
+
if self._workers:
|
|
4767
|
+
await asyncio.gather(*self._workers, return_exceptions=True)
|
|
4768
|
+
|
|
4769
|
+
self._workers.clear()
|
|
4770
|
+
|
|
4761
4771
|
logger.info("[=] Threaded message queue stopped")
|
|
4762
4772
|
|
|
4763
4773
|
def get_stats(self) -> Dict:
|
|
@@ -4854,6 +4864,7 @@ class AgentDistributedInference:
|
|
|
4854
4864
|
self.message_timeout = 30.0
|
|
4855
4865
|
self.CHUNK_SIZE = 8192
|
|
4856
4866
|
self.predict_manager = predict_manager
|
|
4867
|
+
self._health_check_interval = 30 # seconds
|
|
4857
4868
|
|
|
4858
4869
|
self.use_async = use_async
|
|
4859
4870
|
|
|
@@ -4873,7 +4884,6 @@ class AgentDistributedInference:
|
|
|
4873
4884
|
# Queue for outgoing messages (buffered with retry)
|
|
4874
4885
|
self.outgoing_queue = deque()
|
|
4875
4886
|
self.queue_processor_thread = None
|
|
4876
|
-
self._health_check_interval = 10 # seconds
|
|
4877
4887
|
self._last_health_check = time.time()
|
|
4878
4888
|
|
|
4879
4889
|
# Trust configuration
|
|
@@ -4884,7 +4894,6 @@ class AgentDistributedInference:
|
|
|
4884
4894
|
|
|
4885
4895
|
self.pending_requests = {} # request_id -> Future
|
|
4886
4896
|
self.request_lock = threading.Lock()
|
|
4887
|
-
|
|
4888
4897
|
|
|
4889
4898
|
# ============ SECURITY FEATURES ============
|
|
4890
4899
|
|
|
@@ -5189,6 +5198,8 @@ class AgentDistributedInference:
|
|
|
5189
5198
|
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
5190
5199
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
5191
5200
|
self.socket.bind(('0.0.0.0', self.port))
|
|
5201
|
+
|
|
5202
|
+
self.socket.settimeout(1.0)
|
|
5192
5203
|
self.socket.listen(5)
|
|
5193
5204
|
self.running = True
|
|
5194
5205
|
logger.info(f"[=] Server started on port {self.port} with SSL={'enabled' if self.enable_ssl else 'disabled'}")
|
|
@@ -5246,7 +5257,10 @@ class AgentDistributedInference:
|
|
|
5246
5257
|
thread = threading.Thread(target=self._handle_client, args=(client, addr))
|
|
5247
5258
|
thread.daemon = True
|
|
5248
5259
|
thread.start()
|
|
5249
|
-
|
|
5260
|
+
|
|
5261
|
+
except socket.timeout:
|
|
5262
|
+
continue
|
|
5263
|
+
|
|
5250
5264
|
except Exception as e:
|
|
5251
5265
|
if self.running:
|
|
5252
5266
|
print(f"[-] Accept error: {e}")
|
|
@@ -5270,18 +5284,26 @@ class AgentDistributedInference:
|
|
|
5270
5284
|
|
|
5271
5285
|
|
|
5272
5286
|
def stop_server(self):
|
|
5273
|
-
self.running = False
|
|
5274
|
-
if self.socket:
|
|
5275
|
-
self.socket.close()
|
|
5276
|
-
|
|
5287
|
+
self.running = False
|
|
5277
5288
|
# Close all connections
|
|
5278
5289
|
for conn in self.connections:
|
|
5279
|
-
try:
|
|
5290
|
+
try:
|
|
5280
5291
|
self._send_message(conn, {'type': self.MSG_TYPES['DISCONNECT']})
|
|
5292
|
+
|
|
5293
|
+
conn.shutdown(socket.SHUT_RDWR)
|
|
5281
5294
|
conn.close()
|
|
5282
|
-
except:
|
|
5295
|
+
except Exception as e:
|
|
5296
|
+
print(f'[= ERROR =] Socket cant be shutdown due to: {e}')
|
|
5283
5297
|
pass
|
|
5284
|
-
|
|
5298
|
+
|
|
5299
|
+
self.connections.clear()
|
|
5300
|
+
if self.socket:
|
|
5301
|
+
try:
|
|
5302
|
+
self.socket.close()
|
|
5303
|
+
except Exception as e:
|
|
5304
|
+
print(f'[= ERROR =] Socket cant be closed due to: {e}')
|
|
5305
|
+
pass
|
|
5306
|
+
|
|
5285
5307
|
print("[🛑] Server stopped")
|
|
5286
5308
|
|
|
5287
5309
|
# ============ CLIENT METHODS ============
|
|
@@ -5801,9 +5823,13 @@ class AgentDistributedInference:
|
|
|
5801
5823
|
def _start_health_checker(self):
|
|
5802
5824
|
# Start background health checker for async mode.
|
|
5803
5825
|
def health_check_loop():
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5826
|
+
for _ in range(self._health_check_interval * 10):
|
|
5827
|
+
if not self.running:
|
|
5828
|
+
return
|
|
5829
|
+
time.sleep(0.1)
|
|
5830
|
+
|
|
5831
|
+
if self.running:
|
|
5832
|
+
self._check_agent_health()
|
|
5807
5833
|
|
|
5808
5834
|
self._health_thread = threading.Thread(target=health_check_loop, daemon=True)
|
|
5809
5835
|
self._health_thread.start()
|
|
@@ -5840,7 +5866,18 @@ class AgentDistributedInference:
|
|
|
5840
5866
|
# Graceful shutdown.
|
|
5841
5867
|
logger.info("[=] Shutting down AgentDistributedInference...")
|
|
5842
5868
|
self.running = False
|
|
5843
|
-
|
|
5869
|
+
|
|
5870
|
+
try:
|
|
5871
|
+
loop = asyncio.get_event_loop()
|
|
5872
|
+
if loop.is_running():
|
|
5873
|
+
loop.call_soon_threadsafe(
|
|
5874
|
+
lambda: asyncio.ensure_future(self.message_queue.stop())
|
|
5875
|
+
)
|
|
5876
|
+
else:
|
|
5877
|
+
loop.run_until_complete(self.message_queue.stop())
|
|
5878
|
+
except Exception as e:
|
|
5879
|
+
logger.warning(f"[=] Message queue stop warning: {e}")
|
|
5880
|
+
|
|
5844
5881
|
logger.info("[=] Shutdown complete")
|
|
5845
5882
|
|
|
5846
5883
|
# ============ MESSAGE HANDLING ============
|
|
@@ -7446,12 +7483,21 @@ class IntegratedPipeline:
|
|
|
7446
7483
|
|
|
7447
7484
|
print("✅ Async shutdown complete")
|
|
7448
7485
|
|
|
7449
|
-
def shutdown(self):
|
|
7450
|
-
# Synchronous shutdown (for non-async contexts).
|
|
7486
|
+
async def shutdown(self):
|
|
7451
7487
|
if self.distribution:
|
|
7452
|
-
self.distribution.stop()
|
|
7453
|
-
|
|
7488
|
+
self.distribution.stop() # sync call
|
|
7489
|
+
self.distribution.stop_server()
|
|
7490
|
+
|
|
7491
|
+
|
|
7492
|
+
if hasattr(self, '_shutdown_event'):
|
|
7493
|
+
self._shutdown_event.set()
|
|
7454
7494
|
|
|
7495
|
+
# cancel async tasks
|
|
7496
|
+
if self._async_tasks:
|
|
7497
|
+
for task in self._async_tasks:
|
|
7498
|
+
if not task.done():
|
|
7499
|
+
task.cancel()
|
|
7500
|
+
await asyncio.gather(*self._async_tasks, return_exceptions=True)
|
|
7455
7501
|
|
|
7456
7502
|
|
|
7457
7503
|
def cosine_similarity(self, a, b):
|
|
@@ -9790,16 +9836,31 @@ class WorkerPool:
|
|
|
9790
9836
|
async def stop(self):
|
|
9791
9837
|
# Stop all workers
|
|
9792
9838
|
self._running = False
|
|
9839
|
+
await self.result_queue.stop()
|
|
9840
|
+
|
|
9841
|
+
# cancel and wait for all workers to exit cleanly
|
|
9793
9842
|
for worker in self._workers:
|
|
9794
9843
|
worker.cancel()
|
|
9795
|
-
|
|
9796
|
-
|
|
9844
|
+
|
|
9845
|
+
if self._workers:
|
|
9846
|
+
await asyncio.gather(*self._workers, return_exceptions=True)
|
|
9847
|
+
|
|
9848
|
+
self._workers.clear()
|
|
9849
|
+
|
|
9850
|
+
|
|
9797
9851
|
async def _worker(self, predict_func):
|
|
9798
9852
|
# Worker that processes requests
|
|
9799
9853
|
while self._running:
|
|
9800
9854
|
try:
|
|
9801
9855
|
# Get next pending request
|
|
9802
|
-
|
|
9856
|
+
try:
|
|
9857
|
+
request = await asyncio.wait_for(
|
|
9858
|
+
self.result_queue.get_pending(),
|
|
9859
|
+
timeout=1.0
|
|
9860
|
+
)
|
|
9861
|
+
except asyncio.TimeoutError:
|
|
9862
|
+
continue # no request yet, re-check self._running
|
|
9863
|
+
|
|
9803
9864
|
if not request:
|
|
9804
9865
|
continue
|
|
9805
9866
|
|
|
@@ -9809,20 +9870,29 @@ class WorkerPool:
|
|
|
9809
9870
|
|
|
9810
9871
|
try:
|
|
9811
9872
|
# Execute prediction (run sync function in thread pool)
|
|
9812
|
-
result = await asyncio.
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9873
|
+
result = await asyncio.wait_for(
|
|
9874
|
+
asyncio.to_thread(
|
|
9875
|
+
predict_func,
|
|
9876
|
+
texts=request.texts,
|
|
9877
|
+
api_key=request.api_key,
|
|
9878
|
+
client_ip=request.client_ip
|
|
9879
|
+
),
|
|
9880
|
+
timeout=30.0
|
|
9817
9881
|
)
|
|
9818
9882
|
|
|
9819
9883
|
# Mark as completed
|
|
9820
9884
|
await self.result_queue.complete(request.request_id, result)
|
|
9821
|
-
|
|
9885
|
+
except asyncio.TimeoutError:
|
|
9886
|
+
await self.result_queue._mark_failed(request.request_id, 'timeout')
|
|
9887
|
+
except asyncio.CancelledError:
|
|
9888
|
+
# shutdown mid-prediction — mark failed and exit cleanly
|
|
9889
|
+
await self.result_queue._mark_failed(request.request_id, 'cancelled')
|
|
9890
|
+
break
|
|
9891
|
+
|
|
9822
9892
|
except Exception as e:
|
|
9823
9893
|
# Mark as failed
|
|
9824
9894
|
await self.result_queue._mark_failed(request.request_id, str(e))
|
|
9825
|
-
|
|
9895
|
+
|
|
9826
9896
|
except asyncio.CancelledError:
|
|
9827
9897
|
break
|
|
9828
9898
|
except Exception as e:
|
|
@@ -11036,8 +11106,8 @@ class PipelineAsyncManager:
|
|
|
11036
11106
|
self._thread = None
|
|
11037
11107
|
self._queue_worker = None
|
|
11038
11108
|
self._health_thread = None
|
|
11039
|
-
|
|
11040
|
-
logger.info("[-]
|
|
11109
|
+
print('[=] PipelineAsync Wrapper stopped')
|
|
11110
|
+
logger.info("[-] PipelineAsync Wrapper stopped")
|
|
11041
11111
|
return True
|
|
11042
11112
|
|
|
11043
11113
|
def __enter__(self):
|
|
@@ -12350,6 +12420,7 @@ class ConsecutivePeerAgent:
|
|
|
12350
12420
|
self.stats['predictions'] += 1
|
|
12351
12421
|
return best_result
|
|
12352
12422
|
|
|
12423
|
+
|
|
12353
12424
|
def start_server(self):
|
|
12354
12425
|
"""Start server to accept peer connections"""
|
|
12355
12426
|
|
|
@@ -12357,8 +12428,12 @@ class ConsecutivePeerAgent:
|
|
|
12357
12428
|
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
12358
12429
|
self.server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
12359
12430
|
self.server_socket.bind(('0.0.0.0', self.port))
|
|
12360
|
-
|
|
12431
|
+
self.server_socket.settimeout(1.0)
|
|
12361
12432
|
self.server_socket.listen(5)
|
|
12433
|
+
|
|
12434
|
+
if self.pipeline.distribution.enable_ssl and self.pipeline.distribution.ssl_context:
|
|
12435
|
+
self.server_socket = self.pipeline.distribution.ssl_context.wrap_socket(self.server_socket, server_side=True)
|
|
12436
|
+
|
|
12362
12437
|
self.running = True
|
|
12363
12438
|
|
|
12364
12439
|
print(f"[ConsecutivePeerAgent] Server listening on port {self.port}!")
|
|
@@ -12377,14 +12452,22 @@ class ConsecutivePeerAgent:
|
|
|
12377
12452
|
thread = threading.Thread(target=self._handle_client, args=(client, addr))
|
|
12378
12453
|
thread.daemon = True
|
|
12379
12454
|
thread.start()
|
|
12380
|
-
|
|
12455
|
+
except socket.timeout:
|
|
12456
|
+
continue
|
|
12381
12457
|
except Exception as e:
|
|
12382
12458
|
if self.running:
|
|
12383
|
-
|
|
12459
|
+
print(f"[ConsecutivePeerAgent] Server error: {e}")
|
|
12460
|
+
try:
|
|
12461
|
+
self.server_socket.close()
|
|
12462
|
+
except:
|
|
12463
|
+
pass
|
|
12464
|
+
|
|
12465
|
+
print("[ConsecutivePeerAgent] Server Successfully Stopped listening !")
|
|
12384
12466
|
|
|
12385
12467
|
thread = threading.Thread(target=server_loop, daemon=True)
|
|
12386
12468
|
thread.start()
|
|
12387
|
-
|
|
12469
|
+
|
|
12470
|
+
|
|
12388
12471
|
def _handle_client(self, client, addr):
|
|
12389
12472
|
# Handle incoming peer connection
|
|
12390
12473
|
print(f"[ConsecutivePeerAgent] Client connected from {addr}")
|
|
@@ -12450,21 +12533,32 @@ class ConsecutivePeerAgent:
|
|
|
12450
12533
|
def stop_server(self):
|
|
12451
12534
|
self.running = False
|
|
12452
12535
|
|
|
12453
|
-
print('[ConsecutivePeerAgent] Server shutdown
|
|
12454
|
-
if self.server_socket:
|
|
12455
|
-
self.server_socket.close()
|
|
12456
|
-
|
|
12536
|
+
print('[ConsecutivePeerAgent] Initiating Server shutdown...')
|
|
12457
12537
|
# Close all peer connections
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12538
|
+
try:
|
|
12539
|
+
with self._lock:
|
|
12540
|
+
for key, info in self.connected_peers.items():
|
|
12541
|
+
try:
|
|
12542
|
+
info['sock'].shutdown(socket.SHUT_RDWR)
|
|
12543
|
+
info['sock'].close()
|
|
12544
|
+
except:
|
|
12545
|
+
pass
|
|
12546
|
+
|
|
12547
|
+
self.connected_peers.clear()
|
|
12548
|
+
if self.server_socket:
|
|
12549
|
+
try:
|
|
12550
|
+
self.server_socket.close()
|
|
12551
|
+
except Exception as e:
|
|
12552
|
+
print(f'[ConsecutivePeerAgent] Cant close socket: {e}')
|
|
12553
|
+
pass
|
|
12554
|
+
|
|
12555
|
+
print('[ConsecutivePeerAgent] Server Successfully Stopped listening !')
|
|
12556
|
+
|
|
12557
|
+
except Exception as e:
|
|
12558
|
+
print(f'[ConsecutivePeerAgent] Error closing socket: {e}')
|
|
12559
|
+
pass
|
|
12560
|
+
|
|
12561
|
+
|
|
12468
12562
|
def get_stats(self) -> Dict:
|
|
12469
12563
|
# Get statistics
|
|
12470
12564
|
return {
|
|
@@ -13652,23 +13746,40 @@ class CohesiveAgentDeployment:
|
|
|
13652
13746
|
# Graceful shutdown of all components
|
|
13653
13747
|
logger.info("🛑 Shutting down agent...")
|
|
13654
13748
|
|
|
13655
|
-
#
|
|
13749
|
+
# signal shutdown to all loops
|
|
13656
13750
|
self._shutdown_event.set()
|
|
13751
|
+
|
|
13752
|
+
# stop worker pool.
|
|
13753
|
+
if hasattr(self, 'worker_pool'):
|
|
13754
|
+
await self.worker_pool.stop()
|
|
13755
|
+
|
|
13756
|
+
if hasattr(self, 'result_queue'):
|
|
13757
|
+
await self.result_queue.stop()
|
|
13758
|
+
|
|
13759
|
+
# cancel peer tasks
|
|
13760
|
+
if self._peer_tasks:
|
|
13761
|
+
for task in self._peer_tasks:
|
|
13762
|
+
task.cancel()
|
|
13763
|
+
await asyncio.gather(*self._peer_tasks, return_exceptions=True)
|
|
13657
13764
|
|
|
13658
|
-
#
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
#
|
|
13765
|
+
# stop peer agent server
|
|
13766
|
+
if hasattr(self, '_peer_agent'):
|
|
13767
|
+
self._peer_agent.stop_server()
|
|
13768
|
+
|
|
13769
|
+
# stop distribution server
|
|
13663
13770
|
if self.enable_peers:
|
|
13664
13771
|
self.pipeline.distribution.stop_server()
|
|
13665
|
-
|
|
13666
|
-
#
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13772
|
+
|
|
13773
|
+
# FIX 1 — offload blocking stop() to thread so event loop stays free
|
|
13774
|
+
print('[=] Stopping Asynchronous manager setup...')
|
|
13775
|
+
await asyncio.get_event_loop().run_in_executor(
|
|
13776
|
+
None,
|
|
13777
|
+
lambda: self.async_manager.stop(timeout=5, force=True)
|
|
13778
|
+
)
|
|
13779
|
+
|
|
13780
|
+
await asyncio.sleep(0.5)
|
|
13781
|
+
print('✅ Agent shutdown complete')
|
|
13782
|
+
|
|
13672
13783
|
logger.info("✅ Agent shutdown complete")
|
|
13673
13784
|
|
|
13674
13785
|
def get_api_key(self) -> str:
|
|
@@ -13765,19 +13876,19 @@ async def run_secure_agent_cluster(pipeline,test_titles, label_map, rules, agent
|
|
|
13765
13876
|
print(f" Second Confidence: {result2.get('confidence', 0):.2%}")
|
|
13766
13877
|
|
|
13767
13878
|
# Keep running briefly
|
|
13768
|
-
print("\n⏳ Cluster stable. Waiting
|
|
13769
|
-
await asyncio.sleep(
|
|
13879
|
+
print("\n⏳ Cluster stable. Waiting 30 seconds before shutdown...")
|
|
13880
|
+
await asyncio.sleep(30)
|
|
13881
|
+
agent1._peer_agent.stop_server()
|
|
13770
13882
|
agent2._peer_agent.stop_server()
|
|
13771
13883
|
|
|
13772
13884
|
except Exception as e:
|
|
13773
13885
|
print(f"\n❌ Error in cluster: {e}")
|
|
13774
13886
|
traceback.print_exc()
|
|
13775
13887
|
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
print("✅ Cluster shutdown complete")
|
|
13888
|
+
print("\n🛑 Shutting down cluster...")
|
|
13889
|
+
await agent1.shutdown()
|
|
13890
|
+
await agent2.shutdown()
|
|
13891
|
+
print("✅ Cluster shutdown complete")
|
|
13781
13892
|
|
|
13782
13893
|
|
|
13783
13894
|
|
|
@@ -13786,12 +13897,14 @@ async def example_async_with_result_queue(pipeline, test_titles, label_map, rule
|
|
|
13786
13897
|
# Example using the proper result queue
|
|
13787
13898
|
|
|
13788
13899
|
agent = CohesiveAgentDeployment(
|
|
13900
|
+
pipeline=pipeline,
|
|
13789
13901
|
memory_name="test_agent",
|
|
13790
13902
|
filename=filename,
|
|
13791
13903
|
target_title=title_name,
|
|
13792
13904
|
label_name=label_name,
|
|
13793
13905
|
security_level="DEVELOPMENT",
|
|
13794
|
-
enable_peers=False
|
|
13906
|
+
enable_peers=False,
|
|
13907
|
+
peer_discovery_port=5558
|
|
13795
13908
|
)
|
|
13796
13909
|
|
|
13797
13910
|
await agent.start()
|
|
@@ -13909,7 +14022,7 @@ def initiate_graceful_shutdown(pipeline, wrapper):
|
|
|
13909
14022
|
print("[!] Some requests still pending")
|
|
13910
14023
|
|
|
13911
14024
|
# Graceful shutdown
|
|
13912
|
-
wrapper.stop(
|
|
14025
|
+
wrapper.stop()
|
|
13913
14026
|
|
|
13914
14027
|
def AsyncWrappertest(pipeline, prediction_manager, test_titles, label_map, rules):
|
|
13915
14028
|
print("\n" + "="*60)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AbstractIntegratedModule
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.8
|
|
4
4
|
Summary: Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
|
|
5
5
|
Author: Micro-Novelty
|
|
6
6
|
Author-email: hernikpuspita5@gmail.com
|
|
@@ -42,7 +42,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
|
|
|
42
42
|
#### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
|
|
43
43
|
|
|
44
44
|
### Library Short Description:
|
|
45
|
-
- Development Stage: Beta, 0.3.
|
|
45
|
+
- Development Stage: Beta, 0.3.8.
|
|
46
46
|
- Maintainer: Micro-Novelty.
|
|
47
47
|
- library Source-Code is Open-sourced on github.
|
|
48
48
|
- Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
|
|
@@ -10,7 +10,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
|
|
|
10
10
|
#### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
|
|
11
11
|
|
|
12
12
|
### Library Short Description:
|
|
13
|
-
- Development Stage: Beta, 0.3.
|
|
13
|
+
- Development Stage: Beta, 0.3.8.
|
|
14
14
|
- Maintainer: Micro-Novelty.
|
|
15
15
|
- library Source-Code is Open-sourced on github.
|
|
16
16
|
- Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
|
|
@@ -8,7 +8,7 @@ class BinaryDistribution(Distribution):
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="AbstractIntegratedModule",
|
|
11
|
-
version="0.3.
|
|
11
|
+
version="0.3.8",
|
|
12
12
|
description="Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework",
|
|
13
13
|
long_description=open("README.md", encoding="utf-8").read(),
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|