visionai-sdk-python 2.2.0.dev3__py3-none-any.whl → 2.2.0.dev4__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.
@@ -0,0 +1,28 @@
1
+ """The ADR's JSON examples, shipped so every implementation tests against the same frames.
2
+
3
+ ``example("register")`` is the parsed object, ``example_text("register")`` the wire text.
4
+ """
5
+
6
+ import json
7
+ from importlib.resources import files
8
+
9
+ NAMES = (
10
+ "register",
11
+ "registered",
12
+ "heartbeat",
13
+ "request",
14
+ "response",
15
+ "response_text",
16
+ "error_request",
17
+ "error_connection",
18
+ )
19
+
20
+
21
+ def example_text(name: str) -> str:
22
+ """One ADR example as the text that goes over the wire."""
23
+ return (files(__package__) / f"{name}.json").read_text(encoding="utf-8")
24
+
25
+
26
+ def example(name: str) -> dict:
27
+ """One ADR example as a dict, for building or comparing frames in tests."""
28
+ return json.loads(example_text(name))
@@ -0,0 +1,3 @@
1
+ {"type": "error",
2
+ "code": "invalid_message",
3
+ "message": "unknown type 'ping'"}
@@ -0,0 +1,4 @@
1
+ {"type": "error",
2
+ "request_id": "7f3c2a1e-9d4b-4c8a-b2e6-1f5d3a7c9e0b",
3
+ "code": "upstream_unreachable",
4
+ "message": "connect to vlm-scheduling-service-backend.31a6638a-5c2e-4f1b-9a7d-0e3c6b8d2f41.svc.cluster.local:80 failed"}
@@ -0,0 +1 @@
1
+ {"type": "heartbeat"}
@@ -0,0 +1,8 @@
1
+ {"type": "register",
2
+ "agent_id": "platform-edge-agent-7d9f4b6c8-xk2pq",
3
+ "cluster_id": "aws-offline-edge",
4
+ "workspaces": [{"id": "31a6638a-5c2e-4f1b-9a7d-0e3c6b8d2f41",
5
+ "models": [{"name": "cr2-8b", "version": "4.5.0", "replicas": 2},
6
+ {"name": "cr2-8b", "version": "4.6.0", "replicas": 1}]},
7
+ {"id": "7589d018-2b4c-4e6f-8a1d-3c5e7f9b1d23", "models": []},
8
+ {"id": "QA Workspace", "models": []}]}
@@ -0,0 +1,4 @@
1
+ {"type": "registered",
2
+ "accepted": ["31a6638a-5c2e-4f1b-9a7d-0e3c6b8d2f41"],
3
+ "rejected": [{"id": "7589d018-2b4c-4e6f-8a1d-3c5e7f9b1d23", "reason": "cluster_mismatch"},
4
+ {"id": "QA Workspace", "reason": "invalid_id"}]}
@@ -0,0 +1,17 @@
1
+ {"type": "request",
2
+ "request_id": "7f3c2a1e-9d4b-4c8a-b2e6-1f5d3a7c9e0b",
3
+ "workspace_id": "31a6638a-5c2e-4f1b-9a7d-0e3c6b8d2f41",
4
+ "method": "POST",
5
+ "path": "/api/chat",
6
+ "headers": {"Authorization": "Bearer eyJhbGciOi…",
7
+ "X-Request-Source": "dataverse",
8
+ "Content-Type": "application/json"},
9
+ "body": {"img": "data:image/jpeg;base64,/9j/4AAQ…",
10
+ "prompt": "Describe the scene.",
11
+ "temperature": 0.2, "max_tokens": 500, "top_p": 0.7,
12
+ "stream": false, "use_cache": true, "num_beams": 1,
13
+ "model": "cr2-8b", "model_version": null,
14
+ "api_endpoint": null, "hook": null,
15
+ "keep_alive": true, "use_response_postprocess": true,
16
+ "workspace_id": "31a6638a-5c2e-4f1b-9a7d-0e3c6b8d2f41"},
17
+ "timeout_s": 100}
@@ -0,0 +1,9 @@
1
+ {"type": "response",
2
+ "request_id": "7f3c2a1e-9d4b-4c8a-b2e6-1f5d3a7c9e0b",
3
+ "status": 200,
4
+ "headers": {"Content-Type": "application/json"},
5
+ "body": {"chat_id": "high:1760424000123-3f9a1c7e",
6
+ "status": "completed",
7
+ "message": "{\"description\": \"A forklift in a warehouse aisle.\"}",
8
+ "dispatch": {"model_name": "cr2-8b", "model_version": "4.5.0",
9
+ "api_endpoint": "http://cr2-8b:8000"}}}
@@ -0,0 +1,5 @@
1
+ {"type": "response",
2
+ "request_id": "7f3c2a1e-9d4b-4c8a-b2e6-1f5d3a7c9e0b",
3
+ "status": 500,
4
+ "headers": {"Content-Type": "text/plain; charset=utf-8"},
5
+ "body": "Internal Server Error"}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: visionai-sdk-python
3
- Version: 2.2.0.dev3
3
+ Version: 2.2.0.dev4
4
4
  Summary: VisionAI SDK for Python
5
5
  Author-email: Tony Yang <tonyyang@linkervision.com>
6
6
  Requires-Python: >=3.11
@@ -170,8 +170,9 @@ authentication wins. `vlm_url` is optional for clients that only authenticate.
170
170
  platform-edge-agent: the frame models, the constants and `parse_agent_frame()` /
171
171
  `parse_relay_frame()` / `dump_frame()`. The spec is platform-service's
172
172
  `docs/adr/0001-relay-protocol.md`; both sides import this module instead of keeping a
173
- copy, and the ADR's JSON examples are this package's tests. It is internal to the
174
- platform and not a public API.
173
+ copy. The ADR's JSON examples ship with it (`visionai_sdk_python.relay.examples`:
174
+ `example(name)` / `example_text(name)`), so every implementation tests against the same
175
+ frames. It is internal to the platform and not a public API.
175
176
 
176
177
  ## VLM Inference
177
178
 
@@ -18,13 +18,22 @@ visionai_sdk_python/auth/models.py,sha256=u6MDFYaWMyf08XCrGZzwPHv43d6AElH9XO2QSj
18
18
  visionai_sdk_python/auth/resource.py,sha256=3PgcxH8N6unKTs2jSQhMeJT_lg6bTce0hz0bzuID12U,5446
19
19
  visionai_sdk_python/relay/__init__.py,sha256=N4DuhutN8P4EWZRFIaWTqvylNsLkzRSkHMRRF2pknFk,1296
20
20
  visionai_sdk_python/relay/protocol.py,sha256=Hy7J4kgDxaKy0WOrtkmqD5xUFXgKAVXwTWX4NQ9yQHE,5561
21
+ visionai_sdk_python/relay/examples/__init__.py,sha256=GvjlP-EtrhDVgqReOYqcf1mObND61vO6Q8CT_YFfgDM,732
22
+ visionai_sdk_python/relay/examples/error_connection.json,sha256=stjkXo27Vkhoy0rNtPUti2OEXzioxJ8Aqgyq2hAdquA,81
23
+ visionai_sdk_python/relay/examples/error_request.json,sha256=iUB11sSf1vuBAdzvoiHAoUoifZoG4-wGBK6gb0ConjA,228
24
+ visionai_sdk_python/relay/examples/heartbeat.json,sha256=CZKMBTkVxtLzY05bQW7AkCULJAIu-7RUVjgc7hTgg9I,22
25
+ visionai_sdk_python/relay/examples/register.json,sha256=dxpuAsXQhwUb0CZm0xNfj_JkoA8wFPyf49SQuW4aeKI,472
26
+ visionai_sdk_python/relay/examples/registered.json,sha256=SW2vzae2ctLNJE7zGZ_3fk9oj48g9WZz7QpOs9eMbTw,233
27
+ visionai_sdk_python/relay/examples/request.json,sha256=J2XJnxSrZnAde11CUUUkVL1y0PdK9basdr4idpSLRLk,794
28
+ visionai_sdk_python/relay/examples/response.json,sha256=DIzigd4XbH25HeQ4HFsfE8JFERILFOxHSyr8dyHdV2w,443
29
+ visionai_sdk_python/relay/examples/response_text.json,sha256=NRuP-l58xqVBWvOgrwReeDRnOCKtY-it-hq5UYASTug,185
21
30
  visionai_sdk_python/vlm/__init__.py,sha256=EDd7ZG4k7inn8qqkyIhO3xI_4MPMWJT5Npsient-tTc,571
22
31
  visionai_sdk_python/vlm/_mixin.py,sha256=TkqezNpW8QEe9pujsvx1APcylYQYr_PvHruEz4Le3JQ,1718
23
32
  visionai_sdk_python/vlm/async_resource.py,sha256=meMUfBDa0g1hk7vFZq2fDuIQ1-QUpU0BUJtbvuG8UEY,3461
24
33
  visionai_sdk_python/vlm/models.py,sha256=yDFjo4LfAxqXYBnl6ZW7YUJQoKKRkQWtqBJi2ruI6Jw,984
25
34
  visionai_sdk_python/vlm/preprocess.py,sha256=ZpJJa13h8_YKwh_P7Pn8WIXV0x-r2xJi-ETgCFsGw-Y,7892
26
35
  visionai_sdk_python/vlm/resource.py,sha256=4eMQ4ACcgd7nUfdRyADWmPd8yZ--uqQC4zwzBft68lg,3386
27
- visionai_sdk_python-2.2.0.dev3.dist-info/METADATA,sha256=yaMgyrv9_edbxVHgdaOFTCc2EhV1YFjjZDaxa2D3Lt4,30403
28
- visionai_sdk_python-2.2.0.dev3.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
29
- visionai_sdk_python-2.2.0.dev3.dist-info/top_level.txt,sha256=79a5MCSLLv6Mbfun-8RS-G6O927hahBwDqJjeuWLdvM,20
30
- visionai_sdk_python-2.2.0.dev3.dist-info/RECORD,,
36
+ visionai_sdk_python-2.2.0.dev4.dist-info/METADATA,sha256=sTQXZIrAJy5ANXFc2Up7r5BIeY8adzLhErAmTJh0Bjw,30521
37
+ visionai_sdk_python-2.2.0.dev4.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
38
+ visionai_sdk_python-2.2.0.dev4.dist-info/top_level.txt,sha256=79a5MCSLLv6Mbfun-8RS-G6O927hahBwDqJjeuWLdvM,20
39
+ visionai_sdk_python-2.2.0.dev4.dist-info/RECORD,,