matrice-inference 0.1.0__py3-none-manylinux_2_17_x86_64.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.

Potentially problematic release.


This version of matrice-inference might be problematic. Click here for more details.

Files changed (80) hide show
  1. matrice_inference/deploy/aggregator/aggregator.cpython-312-x86_64-linux-gnu.so +0 -0
  2. matrice_inference/deploy/aggregator/aggregator.pyi +55 -0
  3. matrice_inference/deploy/aggregator/analytics.cpython-312-x86_64-linux-gnu.so +0 -0
  4. matrice_inference/deploy/aggregator/analytics.pyi +63 -0
  5. matrice_inference/deploy/aggregator/ingestor.cpython-312-x86_64-linux-gnu.so +0 -0
  6. matrice_inference/deploy/aggregator/ingestor.pyi +79 -0
  7. matrice_inference/deploy/aggregator/pipeline.cpython-312-x86_64-linux-gnu.so +0 -0
  8. matrice_inference/deploy/aggregator/pipeline.pyi +139 -0
  9. matrice_inference/deploy/aggregator/publisher.cpython-312-x86_64-linux-gnu.so +0 -0
  10. matrice_inference/deploy/aggregator/publisher.pyi +59 -0
  11. matrice_inference/deploy/aggregator/synchronizer.cpython-312-x86_64-linux-gnu.so +0 -0
  12. matrice_inference/deploy/aggregator/synchronizer.pyi +58 -0
  13. matrice_inference/deploy/client/auto_streaming/auto_streaming.cpython-312-x86_64-linux-gnu.so +0 -0
  14. matrice_inference/deploy/client/auto_streaming/auto_streaming.pyi +145 -0
  15. matrice_inference/deploy/client/auto_streaming/auto_streaming_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  16. matrice_inference/deploy/client/auto_streaming/auto_streaming_utils.pyi +126 -0
  17. matrice_inference/deploy/client/client.cpython-312-x86_64-linux-gnu.so +0 -0
  18. matrice_inference/deploy/client/client.pyi +337 -0
  19. matrice_inference/deploy/client/client_stream_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  20. matrice_inference/deploy/client/client_stream_utils.pyi +83 -0
  21. matrice_inference/deploy/client/client_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  22. matrice_inference/deploy/client/client_utils.pyi +77 -0
  23. matrice_inference/deploy/client/streaming_gateway/streaming_gateway.cpython-312-x86_64-linux-gnu.so +0 -0
  24. matrice_inference/deploy/client/streaming_gateway/streaming_gateway.pyi +120 -0
  25. matrice_inference/deploy/client/streaming_gateway/streaming_gateway_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  26. matrice_inference/deploy/client/streaming_gateway/streaming_gateway_utils.pyi +442 -0
  27. matrice_inference/deploy/client/streaming_gateway/streaming_results_handler.cpython-312-x86_64-linux-gnu.so +0 -0
  28. matrice_inference/deploy/client/streaming_gateway/streaming_results_handler.pyi +19 -0
  29. matrice_inference/deploy/optimize/cache_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  30. matrice_inference/deploy/optimize/cache_manager.pyi +15 -0
  31. matrice_inference/deploy/optimize/frame_comparators.cpython-312-x86_64-linux-gnu.so +0 -0
  32. matrice_inference/deploy/optimize/frame_comparators.pyi +203 -0
  33. matrice_inference/deploy/optimize/frame_difference.cpython-312-x86_64-linux-gnu.so +0 -0
  34. matrice_inference/deploy/optimize/frame_difference.pyi +165 -0
  35. matrice_inference/deploy/optimize/transmission.cpython-312-x86_64-linux-gnu.so +0 -0
  36. matrice_inference/deploy/optimize/transmission.pyi +97 -0
  37. matrice_inference/deploy/server/inference/batch_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  38. matrice_inference/deploy/server/inference/batch_manager.pyi +50 -0
  39. matrice_inference/deploy/server/inference/inference_interface.cpython-312-x86_64-linux-gnu.so +0 -0
  40. matrice_inference/deploy/server/inference/inference_interface.pyi +114 -0
  41. matrice_inference/deploy/server/inference/model_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  42. matrice_inference/deploy/server/inference/model_manager.pyi +80 -0
  43. matrice_inference/deploy/server/inference/triton_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  44. matrice_inference/deploy/server/inference/triton_utils.pyi +115 -0
  45. matrice_inference/deploy/server/proxy/proxy_interface.cpython-312-x86_64-linux-gnu.so +0 -0
  46. matrice_inference/deploy/server/proxy/proxy_interface.pyi +90 -0
  47. matrice_inference/deploy/server/proxy/proxy_utils.cpython-312-x86_64-linux-gnu.so +0 -0
  48. matrice_inference/deploy/server/proxy/proxy_utils.pyi +113 -0
  49. matrice_inference/deploy/server/server.cpython-312-x86_64-linux-gnu.so +0 -0
  50. matrice_inference/deploy/server/server.pyi +155 -0
  51. matrice_inference/deploy/server/stream/inference_worker.cpython-312-x86_64-linux-gnu.so +0 -0
  52. matrice_inference/deploy/server/stream/inference_worker.pyi +56 -0
  53. matrice_inference/deploy/server/stream/kafka_consumer_worker.cpython-312-x86_64-linux-gnu.so +0 -0
  54. matrice_inference/deploy/server/stream/kafka_consumer_worker.pyi +51 -0
  55. matrice_inference/deploy/server/stream/kafka_producer_worker.cpython-312-x86_64-linux-gnu.so +0 -0
  56. matrice_inference/deploy/server/stream/kafka_producer_worker.pyi +50 -0
  57. matrice_inference/deploy/server/stream/stream_debug_logger.cpython-312-x86_64-linux-gnu.so +0 -0
  58. matrice_inference/deploy/server/stream/stream_debug_logger.pyi +47 -0
  59. matrice_inference/deploy/server/stream/stream_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  60. matrice_inference/deploy/server/stream/stream_manager.pyi +69 -0
  61. matrice_inference/deploy/server/stream/video_buffer.cpython-312-x86_64-linux-gnu.so +0 -0
  62. matrice_inference/deploy/server/stream/video_buffer.pyi +120 -0
  63. matrice_inference/deploy/stream/kafka_stream.cpython-312-x86_64-linux-gnu.so +0 -0
  64. matrice_inference/deploy/stream/kafka_stream.pyi +444 -0
  65. matrice_inference/deploy/stream/redis_stream.cpython-312-x86_64-linux-gnu.so +0 -0
  66. matrice_inference/deploy/stream/redis_stream.pyi +447 -0
  67. matrice_inference/deployment/camera_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  68. matrice_inference/deployment/camera_manager.pyi +669 -0
  69. matrice_inference/deployment/deployment.cpython-312-x86_64-linux-gnu.so +0 -0
  70. matrice_inference/deployment/deployment.pyi +736 -0
  71. matrice_inference/deployment/inference_pipeline.cpython-312-x86_64-linux-gnu.so +0 -0
  72. matrice_inference/deployment/inference_pipeline.pyi +527 -0
  73. matrice_inference/deployment/streaming_gateway_manager.cpython-312-x86_64-linux-gnu.so +0 -0
  74. matrice_inference/deployment/streaming_gateway_manager.pyi +275 -0
  75. matrice_inference/py.typed +0 -0
  76. matrice_inference-0.1.0.dist-info/METADATA +26 -0
  77. matrice_inference-0.1.0.dist-info/RECORD +80 -0
  78. matrice_inference-0.1.0.dist-info/WHEEL +5 -0
  79. matrice_inference-0.1.0.dist-info/licenses/LICENSE.txt +21 -0
  80. matrice_inference-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,447 @@
1
+ """Auto-generated stub for module: redis_stream."""
2
+ from typing import Any, Dict, List, Optional, Set, Tuple, Union
3
+
4
+ from collections import deque
5
+ from datetime import datetime, timezone
6
+ from redis.exceptions import ConnectionError, TimeoutError
7
+ import aioredis
8
+ import asyncio
9
+ import json
10
+ import logging
11
+ import redis
12
+ import threading
13
+ import time
14
+ import uuid
15
+
16
+ # Classes
17
+ class AsyncRedisUtils:
18
+ """
19
+ Utility class for asynchronous Redis operations.
20
+ """
21
+
22
+ def __init__(self: Any, host: str = 'localhost', port: int = 6379, password: Optional[str] = None, username: Optional[str] = None, db: int = 0, ssl: bool = False, ssl_verify: bool = True, connection_timeout: int = 30) -> None: ...
23
+ """
24
+ Initialize async Redis utils with connection parameters.
25
+
26
+ Args:
27
+ host: Redis server hostname or IP address
28
+ port: Redis server port
29
+ password: Password for Redis authentication
30
+ username: Username for Redis authentication (Redis 6.0+)
31
+ db: Database number to connect to
32
+ ssl: Whether to use SSL/TLS connection
33
+ ssl_verify: Whether to verify SSL certificates
34
+ connection_timeout: Connection timeout in seconds
35
+ """
36
+
37
+ async def close(self: Any) -> None: ...
38
+ """
39
+ Close async Redis client and subscriber connections.
40
+ """
41
+
42
+ def configure_metrics_reporting(self: Any, rpc_client: Any, deployment_id: str = None, interval: int = 60, batch_size: int = 1000) -> None: ...
43
+ """
44
+ Configure background metrics reporting to backend API.
45
+
46
+ Args:
47
+ rpc_client: RPC client instance for API communication
48
+ deployment_id: Deployment identifier for metrics context
49
+ interval: Reporting interval in seconds (default: 60)
50
+ batch_size: Maximum metrics per batch (default: 1000)
51
+ """
52
+
53
+ async def get_message(self: Any, timeout: float = 60.0) -> Optional[Dict]: ...
54
+ """
55
+ Get a single message from subscribed channels asynchronously.
56
+
57
+ Args:
58
+ timeout: Maximum time to wait for message in seconds
59
+
60
+ Returns:
61
+ Message dictionary if available, None if no message received
62
+
63
+ Raises:
64
+ RuntimeError: If subscriber is not initialized
65
+ RedisConnectionError: If message retrieval fails
66
+ """
67
+
68
+ def get_metrics(self: Any, clear_after_read: bool = False) -> List[Dict]: ...
69
+ """
70
+ Get collected metrics for aggregation and reporting.
71
+
72
+ Args:
73
+ clear_after_read: Whether to clear metrics after reading
74
+
75
+ Returns:
76
+ List of metric dictionaries
77
+ """
78
+
79
+ async def listen_for_messages(self: Any, callback: Optional[Callable] = None) -> None: ...
80
+ """
81
+ Listen for messages on subscribed channels asynchronously (blocking).
82
+
83
+ Args:
84
+ callback: Optional global callback function for all messages
85
+
86
+ Raises:
87
+ RuntimeError: If subscriber is not set up
88
+ RedisConnectionError: If listening fails
89
+ """
90
+
91
+ async def publish_message(self: Any, channel: str, message: Union[dict, str, bytes, Any], timeout: float = 30.0) -> int: ...
92
+ """
93
+ Publish a message to a Redis channel asynchronously.
94
+
95
+ Args:
96
+ channel: Channel to publish to
97
+ message: Message to publish (dict will be converted to JSON)
98
+ timeout: Maximum time to wait for publish completion in seconds
99
+
100
+ Returns:
101
+ Number of subscribers that received the message
102
+
103
+ Raises:
104
+ RuntimeError: If client is not initialized
105
+ ValueError: If channel or message is invalid
106
+ RedisConnectionError: If message publication fails
107
+ """
108
+
109
+ async def setup_client(self: Any, **kwargs: Any) -> None: ...
110
+ """
111
+ Set up async Redis client connection.
112
+
113
+ Args:
114
+ **kwargs: Additional Redis client configuration options
115
+
116
+ Raises:
117
+ RedisConnectionError: If client initialization fails
118
+ """
119
+
120
+ async def setup_subscriber(self: Any, **kwargs: Any) -> None: ...
121
+ """
122
+ Set up async Redis pub/sub subscriber.
123
+
124
+ Args:
125
+ **kwargs: Additional pub/sub configuration options
126
+
127
+ Raises:
128
+ RedisConnectionError: If subscriber setup fails
129
+ """
130
+
131
+ def stop_metrics_reporting(self: Any) -> None: ...
132
+ """
133
+ Stop the background metrics reporting thread (async version).
134
+ """
135
+
136
+ async def subscribe_to_channel(self: Any, channel: str, callback: Optional[Callable] = None) -> None: ...
137
+ """
138
+ Subscribe to a Redis channel asynchronously.
139
+
140
+ Args:
141
+ channel: Channel to subscribe to
142
+ callback: Optional callback function for message handling
143
+
144
+ Raises:
145
+ RuntimeError: If subscriber is not set up
146
+ RedisConnectionError: If subscription fails
147
+ ValueError: If channel is empty
148
+ """
149
+
150
+ async def unsubscribe_from_channel(self: Any, channel: str) -> None: ...
151
+ """
152
+ Unsubscribe from a Redis channel asynchronously.
153
+
154
+ Args:
155
+ channel: Channel to unsubscribe from
156
+
157
+ Raises:
158
+ RuntimeError: If subscriber is not set up
159
+ """
160
+
161
+ class MatriceRedisDeployment:
162
+ """
163
+ Class for managing Redis deployments for Matrice streaming API.
164
+ """
165
+
166
+ def __init__(self: Any, session: Any, service_id: str, type: str, host: str = 'localhost', port: int = 6379, password: Optional[str] = None, username: Optional[str] = None, db: int = 0, ssl: bool = False, ssl_verify: bool = True, enable_metrics: bool = True, metrics_interval: int = 60) -> None: ...
167
+ """
168
+ Initialize Redis deployment with deployment ID.
169
+
170
+ Args:
171
+ session: Session object for authentication and RPC
172
+ service_id: ID of the deployment
173
+ type: Type of deployment ("client" or "server")
174
+ host: Redis server hostname or IP address
175
+ port: Redis server port
176
+ password: Password for Redis authentication
177
+ username: Username for Redis authentication (Redis 6.0+)
178
+ db: Database number to connect to
179
+ ssl: Whether to use SSL/TLS connection
180
+ ssl_verify: Whether to verify SSL certificates
181
+ enable_metrics: Whether to auto-enable metrics reporting (default: True)
182
+ metrics_interval: Metrics reporting interval in seconds (default: 60)
183
+ Raises:
184
+ ValueError: If type is not "client" or "server"
185
+ """
186
+
187
+ async def async_get_message(self: Any, timeout: float = 60.0) -> Optional[Dict]: ...
188
+ """
189
+ Get a message from Redis asynchronously.
190
+
191
+ Args:
192
+ timeout: Maximum time to wait for message in seconds
193
+
194
+ Returns:
195
+ Message dictionary if available, None if no message received
196
+
197
+ Raises:
198
+ RuntimeError: If subscriber is not initialized
199
+ RedisConnectionError: If message retrieval fails
200
+ """
201
+
202
+ async def async_publish_message(self: Any, message: dict, timeout: float = 60.0) -> int: ...
203
+ """
204
+ Publish a message to Redis asynchronously.
205
+
206
+ Args:
207
+ message: Message to publish
208
+ timeout: Maximum time to wait for message publication in seconds
209
+
210
+ Returns:
211
+ Number of subscribers that received the message
212
+
213
+ Raises:
214
+ RuntimeError: If client is not initialized
215
+ ValueError: If message is invalid
216
+ RedisConnectionError: If message publication fails
217
+ """
218
+
219
+ def check_setup_success(self: Any) -> bool: ...
220
+ """
221
+ Check if the Redis setup is successful.
222
+
223
+ Returns:
224
+ bool: True if setup was successful, False otherwise
225
+ """
226
+
227
+ async def close(self: Any) -> None: ...
228
+ """
229
+ Close Redis client and subscriber connections.
230
+
231
+ This method gracefully closes all Redis connections without raising exceptions
232
+ to ensure proper cleanup during shutdown.
233
+ """
234
+
235
+ def configure_metrics_reporting(self: Any, interval: int = 60, batch_size: int = 1000) -> None: ...
236
+ """
237
+ Configure background metrics reporting for both sync and async Redis utilities.
238
+
239
+ This method enables automatic metrics collection and reporting to the backend API
240
+ for all Redis operations performed through this deployment.
241
+
242
+ Args:
243
+ interval: Reporting interval in seconds (default: 60)
244
+ batch_size: Maximum metrics per batch (default: 1000)
245
+ """
246
+
247
+ def get_all_metrics(self: Any) -> Dict: ...
248
+ """
249
+ Get aggregated metrics from all Redis utilities.
250
+
251
+ Returns:
252
+ Dict: Combined metrics from sync and async Redis utilities
253
+ """
254
+
255
+ def get_message(self: Any, timeout: float = 60.0) -> Optional[Dict]: ...
256
+ """
257
+ Get a message from Redis.
258
+
259
+ Args:
260
+ timeout: Maximum time to wait for message in seconds
261
+
262
+ Returns:
263
+ Message dictionary if available, None if no message received
264
+
265
+ Raises:
266
+ RuntimeError: If subscriber is not initialized
267
+ RedisConnectionError: If message retrieval fails
268
+ """
269
+
270
+ def get_metrics_summary(self: Any) -> Dict: ...
271
+ """
272
+ Get a summary of metrics from all Redis utilities.
273
+
274
+ Returns:
275
+ Dict: Summarized metrics with counts and statistics
276
+ """
277
+
278
+ def publish_message(self: Any, message: dict, timeout: float = 60.0) -> int: ...
279
+ """
280
+ Publish a message to Redis.
281
+
282
+ Args:
283
+ message: Message to publish
284
+ timeout: Maximum time to wait for message publication in seconds
285
+
286
+ Returns:
287
+ Number of subscribers that received the message
288
+
289
+ Raises:
290
+ RuntimeError: If client is not initialized
291
+ ValueError: If message is invalid
292
+ RedisConnectionError: If message publication fails
293
+ """
294
+
295
+ def refresh(self: Any) -> Any: ...
296
+ """
297
+ Refresh the Redis client and subscriber connections.
298
+ """
299
+
300
+ class RedisUtils:
301
+ """
302
+ Utility class for synchronous Redis operations.
303
+ """
304
+
305
+ def __init__(self: Any, host: str = 'localhost', port: int = 6379, password: Optional[str] = None, username: Optional[str] = None, db: int = 0, ssl: bool = False, ssl_verify: bool = True, connection_timeout: int = 30) -> None: ...
306
+ """
307
+ Initialize Redis utils with connection parameters.
308
+
309
+ Args:
310
+ host: Redis server hostname or IP address
311
+ port: Redis server port
312
+ password: Password for Redis authentication
313
+ username: Username for Redis authentication (Redis 6.0+)
314
+ db: Database number to connect to
315
+ ssl: Whether to use SSL/TLS connection
316
+ ssl_verify: Whether to verify SSL certificates
317
+ connection_timeout: Connection timeout in seconds
318
+ """
319
+
320
+ def close(self: Any) -> None: ...
321
+ """
322
+ Close Redis client and subscriber connections.
323
+ """
324
+
325
+ def configure_metrics_reporting(self: Any, rpc_client: Any, deployment_id: str = None, interval: int = 60, batch_size: int = 1000) -> None: ...
326
+ """
327
+ Configure background metrics reporting to backend API.
328
+
329
+ Args:
330
+ rpc_client: RPC client instance for API communication
331
+ deployment_id: Deployment identifier for metrics context
332
+ interval: Reporting interval in seconds (default: 60)
333
+ batch_size: Maximum metrics per batch (default: 1000)
334
+ """
335
+
336
+ def get_message(self: Any, timeout: float = 1.0) -> Optional[Dict]: ...
337
+ """
338
+ Get a single message from subscribed channels.
339
+
340
+ Args:
341
+ timeout: Maximum time to block waiting for message in seconds
342
+
343
+ Returns:
344
+ Message dict if available, None if timeout. Dict contains:
345
+ - type: Message type ('message', 'subscribe', 'unsubscribe', etc.)
346
+ - channel: Channel name
347
+ - data: Message data
348
+ - pattern: Pattern if pattern subscription (None otherwise)
349
+
350
+ Raises:
351
+ RuntimeError: If subscriber is not set up
352
+ RedisConnectionError: If message retrieval fails
353
+ """
354
+
355
+ def get_metrics(self: Any, clear_after_read: bool = False) -> List[Dict]: ...
356
+ """
357
+ Get collected metrics for aggregation and reporting.
358
+
359
+ Args:
360
+ clear_after_read: Whether to clear metrics after reading
361
+
362
+ Returns:
363
+ List of metric dictionaries
364
+ """
365
+
366
+ def listen_for_messages(self: Any, callback: Optional[Callable] = None) -> None: ...
367
+ """
368
+ Listen for messages on subscribed channels (blocking).
369
+
370
+ Args:
371
+ callback: Optional global callback function for all messages
372
+
373
+ Raises:
374
+ RuntimeError: If subscriber is not set up
375
+ RedisConnectionError: If listening fails
376
+ """
377
+
378
+ def publish_message(self: Any, channel: str, message: Union[dict, str, bytes, Any], timeout: float = 30.0) -> int: ...
379
+ """
380
+ Publish message to Redis channel.
381
+
382
+ Args:
383
+ channel: Channel to publish to
384
+ message: Message to publish (dict will be converted to JSON)
385
+ timeout: Maximum time to wait for publish completion in seconds
386
+
387
+ Returns:
388
+ Number of subscribers that received the message
389
+
390
+ Raises:
391
+ RuntimeError: If client is not set up
392
+ RedisConnectionError: If message publication fails
393
+ ValueError: If channel is empty or message is None
394
+ """
395
+
396
+ def setup_client(self: Any, **kwargs: Any) -> None: ...
397
+ """
398
+ Set up Redis client connection.
399
+
400
+ Args:
401
+ **kwargs: Additional Redis client configuration options
402
+
403
+ Raises:
404
+ RedisConnectionError: If client initialization fails
405
+ """
406
+
407
+ def setup_subscriber(self: Any, **kwargs: Any) -> None: ...
408
+ """
409
+ Set up Redis pub/sub subscriber.
410
+
411
+ Args:
412
+ **kwargs: Additional pub/sub configuration options
413
+
414
+ Raises:
415
+ RedisConnectionError: If subscriber setup fails
416
+ """
417
+
418
+ def stop_metrics_reporting(self: Any) -> None: ...
419
+ """
420
+ Stop the background metrics reporting thread.
421
+ """
422
+
423
+ def subscribe_to_channel(self: Any, channel: str, callback: Optional[Callable] = None) -> None: ...
424
+ """
425
+ Subscribe to a Redis channel.
426
+
427
+ Args:
428
+ channel: Channel to subscribe to
429
+ callback: Optional callback function for message handling
430
+
431
+ Raises:
432
+ RuntimeError: If subscriber is not set up
433
+ RedisConnectionError: If subscription fails
434
+ ValueError: If channel is empty
435
+ """
436
+
437
+ def unsubscribe_from_channel(self: Any, channel: str) -> None: ...
438
+ """
439
+ Unsubscribe from a Redis channel.
440
+
441
+ Args:
442
+ channel: Channel to unsubscribe from
443
+
444
+ Raises:
445
+ RuntimeError: If subscriber is not set up
446
+ """
447
+