synapsai-python 0.1.0__tar.gz → 0.1.2__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.
Files changed (54) hide show
  1. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/PKG-INFO +30 -4
  2. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/README.md +27 -2
  3. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/pyproject.toml +6 -2
  4. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/setup.py +8 -2
  5. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/__init__.py +3 -2
  6. synapsai_python-0.1.2/src/synapsai/cli.py +168 -0
  7. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/client.py +245 -84
  8. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/__init__.py +20 -1
  9. synapsai_python-0.1.2/src/synapsai/resources/agents.py +203 -0
  10. synapsai_python-0.1.2/src/synapsai/resources/chat.py +298 -0
  11. synapsai_python-0.1.2/src/synapsai/resources/model_artifacts.py +209 -0
  12. synapsai_python-0.1.2/src/synapsai/resources/responses.py +179 -0
  13. synapsai_python-0.1.2/src/synapsai/resources/vector_stores.py +473 -0
  14. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/__init__.py +40 -1
  15. synapsai_python-0.1.2/src/synapsai/types/agents.py +80 -0
  16. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/completion.py +25 -2
  17. synapsai_python-0.1.2/src/synapsai/types/model_artifacts.py +68 -0
  18. synapsai_python-0.1.2/src/synapsai/types/responses.py +83 -0
  19. synapsai_python-0.1.2/src/synapsai/types/vector_stores.py +134 -0
  20. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai_python.egg-info/PKG-INFO +30 -4
  21. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai_python.egg-info/SOURCES.txt +10 -0
  22. synapsai_python-0.1.2/src/synapsai_python.egg-info/entry_points.txt +2 -0
  23. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai_python.egg-info/requires.txt +2 -1
  24. synapsai_python-0.1.0/src/synapsai/resources/chat.py +0 -199
  25. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/LICENSE +0 -0
  26. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/setup.cfg +0 -0
  27. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/exceptions.py +0 -0
  28. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/logging.py +0 -0
  29. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/processing.py +0 -0
  30. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/audio.py +0 -0
  31. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/classifications.py +0 -0
  32. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/completions.py +0 -0
  33. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/embeddings.py +0 -0
  34. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/feature_extraction.py +0 -0
  35. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/fill_mask.py +0 -0
  36. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/images.py +0 -0
  37. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/models.py +0 -0
  38. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/question_answering.py +0 -0
  39. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/rerank.py +0 -0
  40. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/resources/videos.py +0 -0
  41. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/audio.py +0 -0
  42. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/classifications.py +0 -0
  43. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/common.py +0 -0
  44. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/embeddings.py +0 -0
  45. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/feature_extraction.py +0 -0
  46. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/fill_mask.py +0 -0
  47. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/images.py +0 -0
  48. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/models.py +0 -0
  49. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/question_answering.py +0 -0
  50. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/rerank.py +0 -0
  51. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/types/videos.py +0 -0
  52. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai/utils.py +0 -0
  53. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai_python.egg-info/dependency_links.txt +0 -0
  54. {synapsai_python-0.1.0 → synapsai_python-0.1.2}/src/synapsai_python.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synapsai-python
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: The official SynapsAI Cloud Python SDK
5
5
  Home-page: https://github.com/synapsai-cloud/synapsai
6
6
  Author: SynapsAI Technologies Inc.
@@ -215,7 +215,8 @@ License-File: LICENSE
215
215
  Requires-Dist: httpx>=0.23.0
216
216
  Requires-Dist: pydantic<3,>=2.0
217
217
  Requires-Dist: typing-extensions>=4.5
218
- Requires-Dist: Pillow>=9.5.0
218
+ Requires-Dist: Pillow>=12.2.0
219
+ Requires-Dist: click>=8.0
219
220
  Dynamic: author
220
221
  Dynamic: home-page
221
222
  Dynamic: license-file
@@ -282,7 +283,9 @@ for model in models_page.data:
282
283
 
283
284
  ## Documentation
284
285
 
285
- For advanced configurations, deep-dive usage guides, and comprehensive code examples for every resource, visit our [Examples Documentation](https://docs.synapsai.cloud/examples/introduction).
286
+ Local guides live in [`docs/`](docs/README.md) (getting started, every resource, CLI, async, errors).
287
+
288
+ Online examples: [docs.synapsai.cloud](https://docs.synapsai.cloud/examples/introduction).
286
289
 
287
290
  ---
288
291
 
@@ -293,7 +296,8 @@ The SDK provides native support for the following SynapsAI Cloud capabilities:
293
296
  | Resource | Description |
294
297
  | --- | --- |
295
298
  | **`models`** | Model management and discovery |
296
- | **`chat.completions`** | Chat completions and real-time streaming |
299
+ | **`chat.completions`** | Chat completions, streaming, and stored CRUD |
300
+ | **`responses`** | Responses API create / retrieve / delete |
297
301
  | **`completions`** | Classic text completions |
298
302
  | **`embeddings`** | Text embeddings generation |
299
303
  | **`images`** | Image generation and manipulation |
@@ -304,6 +308,28 @@ The SDK provides native support for the following SynapsAI Cloud capabilities:
304
308
  | **`feature_extraction`** | Feature extraction pipelines |
305
309
  | **`fill_mask`** | Masked Language Modeling (MLM) |
306
310
  | **`rerank`** | Text reranking for search optimization |
311
+ | **`vector_stores`** | Vector stores and file ingestion/search |
312
+ | **`model_artifacts`** | Model artifact upload sessions |
313
+ | **`agents`** | Persisted agent runs (AG-UI SSE) |
314
+
315
+ ---
316
+
317
+ ## CLI
318
+
319
+ After install, the `synapsai` command is available:
320
+
321
+ ```bash
322
+ # Upload a model directory into an existing artifact
323
+ synapsai upload-model ./my-model --artifact-id artifact-demo-abc12345
324
+
325
+ # Upload files or directories into a vector store
326
+ synapsai upload-vector-store-files vs_abc123 ./docs ./readme.md
327
+ ```
328
+
329
+ Environment variables:
330
+
331
+ * `SYNAPSAI_API_KEY` — API key
332
+ * `SYNAPSAI_API_BASE` — API base URL (default `https://api.synapsai.cloud/v1`)
307
333
 
308
334
  ---
309
335
 
@@ -59,7 +59,9 @@ for model in models_page.data:
59
59
 
60
60
  ## Documentation
61
61
 
62
- For advanced configurations, deep-dive usage guides, and comprehensive code examples for every resource, visit our [Examples Documentation](https://docs.synapsai.cloud/examples/introduction).
62
+ Local guides live in [`docs/`](docs/README.md) (getting started, every resource, CLI, async, errors).
63
+
64
+ Online examples: [docs.synapsai.cloud](https://docs.synapsai.cloud/examples/introduction).
63
65
 
64
66
  ---
65
67
 
@@ -70,7 +72,8 @@ The SDK provides native support for the following SynapsAI Cloud capabilities:
70
72
  | Resource | Description |
71
73
  | --- | --- |
72
74
  | **`models`** | Model management and discovery |
73
- | **`chat.completions`** | Chat completions and real-time streaming |
75
+ | **`chat.completions`** | Chat completions, streaming, and stored CRUD |
76
+ | **`responses`** | Responses API create / retrieve / delete |
74
77
  | **`completions`** | Classic text completions |
75
78
  | **`embeddings`** | Text embeddings generation |
76
79
  | **`images`** | Image generation and manipulation |
@@ -81,6 +84,28 @@ The SDK provides native support for the following SynapsAI Cloud capabilities:
81
84
  | **`feature_extraction`** | Feature extraction pipelines |
82
85
  | **`fill_mask`** | Masked Language Modeling (MLM) |
83
86
  | **`rerank`** | Text reranking for search optimization |
87
+ | **`vector_stores`** | Vector stores and file ingestion/search |
88
+ | **`model_artifacts`** | Model artifact upload sessions |
89
+ | **`agents`** | Persisted agent runs (AG-UI SSE) |
90
+
91
+ ---
92
+
93
+ ## CLI
94
+
95
+ After install, the `synapsai` command is available:
96
+
97
+ ```bash
98
+ # Upload a model directory into an existing artifact
99
+ synapsai upload-model ./my-model --artifact-id artifact-demo-abc12345
100
+
101
+ # Upload files or directories into a vector store
102
+ synapsai upload-vector-store-files vs_abc123 ./docs ./readme.md
103
+ ```
104
+
105
+ Environment variables:
106
+
107
+ * `SYNAPSAI_API_KEY` — API key
108
+ * `SYNAPSAI_API_BASE` — API base URL (default `https://api.synapsai.cloud/v1`)
84
109
 
85
110
  ---
86
111
 
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
7
7
 
8
8
  [project]
9
9
  name = "synapsai-python"
10
- version = "0.1.0"
10
+ version = "0.1.2"
11
11
  description = "The official SynapsAI Cloud Python SDK"
12
12
  readme = { file = "README.md", content-type = "text/markdown" }
13
13
  requires-python = ">=3.8"
@@ -23,9 +23,13 @@ dependencies = [
23
23
  "httpx>=0.23.0",
24
24
  "pydantic>=2.0,<3",
25
25
  "typing-extensions>=4.5",
26
- "Pillow>=9.5.0",
26
+ "Pillow>=12.2.0",
27
+ "click>=8.0",
27
28
  ]
28
29
 
30
+ [project.scripts]
31
+ synapsai = "synapsai.cli:main"
32
+
29
33
  [project.urls]
30
34
  Homepage = "https://github.com/synapsai-cloud/synapsai-python"
31
35
 
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="synapsai-python",
5
- version="0.1.0",
5
+ version="0.1.2",
6
6
  description="The official SynapsAI Cloud Python SDK",
7
7
  long_description=open("README.md", "r", encoding="utf-8").read(),
8
8
  long_description_content_type="text/markdown",
@@ -22,6 +22,12 @@ setup(
22
22
  "httpx>=0.23.0",
23
23
  "pydantic>=2.0,<3",
24
24
  "typing-extensions>=4.5",
25
- "Pillow>=9.5.0",
25
+ "Pillow>=12.2.0",
26
+ "click>=8.0",
26
27
  ],
28
+ entry_points={
29
+ "console_scripts": [
30
+ "synapsai=synapsai.cli:main",
31
+ ],
32
+ },
27
33
  )
@@ -5,12 +5,13 @@ A scalable and maintainable Python client library for interacting with SynapsAI
5
5
  compatible with OpenAI API patterns.
6
6
  """
7
7
 
8
- from .client import SynapsAI, AsyncSynapsAI
8
+ from .client import SynapsAI, AsyncSynapsAI, DEFAULT_UPLOAD_BASE_URL
9
9
  from .types import *
10
10
  from .resources import *
11
11
 
12
- __version__ = "0.1.0"
12
+ __version__ = "0.1.2"
13
13
  __all__ = [
14
14
  "SynapsAI",
15
15
  "AsyncSynapsAI",
16
+ "DEFAULT_UPLOAD_BASE_URL",
16
17
  ]
@@ -0,0 +1,168 @@
1
+ # Copyright 2026 SynapsAI Technologies Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ """Command-line interface for SynapsAI uploads."""
16
+
17
+ from __future__ import annotations
18
+
19
+ import json
20
+ import os
21
+ from typing import List, Optional
22
+
23
+ import click
24
+
25
+ from .client import SynapsAI
26
+ from .exceptions import APIError
27
+
28
+
29
+ def _resolve_api_key(api_key: Optional[str]) -> str:
30
+ value = api_key or os.environ.get("SYNAPSAI_API_KEY")
31
+ if not value:
32
+ raise click.ClickException(
33
+ "API key required. Pass --api-key or set SYNAPSAI_API_KEY."
34
+ )
35
+ return value
36
+
37
+
38
+ def _normalize_base_url(host: str) -> str:
39
+ value = host.strip().rstrip("/")
40
+ if not value.startswith("http://") and not value.startswith("https://"):
41
+ value = f"https://{value}"
42
+ if not value.endswith("/v1"):
43
+ value = f"{value}/v1"
44
+ return value
45
+
46
+
47
+ @click.group()
48
+ @click.version_option(version="0.1.0", prog_name="synapsai")
49
+ def main() -> None:
50
+ """SynapsAI Cloud CLI."""
51
+
52
+
53
+ @main.command("upload-model")
54
+ @click.argument("path", type=click.Path(exists=True, file_okay=True, dir_okay=True))
55
+ @click.option("--artifact-id", required=True, help="Existing model artifact id to upload into.")
56
+ @click.option(
57
+ "--host",
58
+ default=None,
59
+ help="API host (default: SYNAPSAI_API_BASE or https://api.synapsai.cloud/v1).",
60
+ )
61
+ @click.option("--api-key", default=None, help="API key (default: SYNAPSAI_API_KEY).")
62
+ @click.option("--timeout", default=3600.0, show_default=True, type=float, help="Request timeout seconds.")
63
+ def upload_model(
64
+ path: str,
65
+ artifact_id: str,
66
+ host: Optional[str],
67
+ api_key: Optional[str],
68
+ timeout: float,
69
+ ) -> None:
70
+ """Upload model files into an existing artifact on the API.
71
+
72
+ PATH may be a single file or a directory of model weights/config files.
73
+ Starts an upload session, streams files, then completes ingest.
74
+ Uses the same host as the rest of the API (``SYNAPSAI_API_BASE`` or
75
+ ``https://api.synapsai.cloud/v1``).
76
+ """
77
+ base_url = _normalize_base_url(host) if host else None
78
+ client = SynapsAI(api_key=_resolve_api_key(api_key), base_url=base_url, timeout=timeout)
79
+
80
+ def on_progress(relative: str, index: int, total: int) -> None:
81
+ click.echo(f"[{index}/{total}] uploading {relative}")
82
+
83
+ try:
84
+ artifact = client.model_artifacts.upload(
85
+ path,
86
+ artifact_id=artifact_id,
87
+ on_progress=on_progress,
88
+ )
89
+ except (APIError, OSError, ValueError) as exc:
90
+ raise click.ClickException(str(exc)) from exc
91
+
92
+ click.echo(
93
+ json.dumps(
94
+ {
95
+ "id": artifact.id,
96
+ "display_name": artifact.display_name,
97
+ "pipeline": artifact.pipeline,
98
+ "status": artifact.status,
99
+ "size_gb": artifact.size_gb,
100
+ },
101
+ indent=2,
102
+ )
103
+ )
104
+
105
+
106
+ @main.command("upload-vector-store-files")
107
+ @click.argument("vector_store_id")
108
+ @click.argument("paths", nargs=-1, required=True, type=click.Path(exists=True))
109
+ @click.option(
110
+ "--host",
111
+ default=None,
112
+ help="API host (default: SYNAPSAI_API_BASE or https://api.synapsai.cloud/v1).",
113
+ )
114
+ @click.option("--api-key", default=None, help="API key (default: SYNAPSAI_API_KEY).")
115
+ @click.option(
116
+ "--attributes",
117
+ default=None,
118
+ help="Optional JSON object applied as metadata attributes on each upload.",
119
+ )
120
+ @click.option("--timeout", default=600.0, show_default=True, type=float, help="Request timeout seconds.")
121
+ def upload_vector_store_files(
122
+ vector_store_id: str,
123
+ paths: List[str],
124
+ host: Optional[str],
125
+ api_key: Optional[str],
126
+ attributes: Optional[str],
127
+ timeout: float,
128
+ ) -> None:
129
+ """Upload files or directories into a vector store.
130
+
131
+ Each PATH may be an individual file or a directory (recursively uploaded).
132
+ """
133
+ parsed_attributes = None
134
+ if attributes:
135
+ try:
136
+ parsed_attributes = json.loads(attributes)
137
+ except json.JSONDecodeError as exc:
138
+ raise click.ClickException("--attributes must be valid JSON") from exc
139
+ if not isinstance(parsed_attributes, dict):
140
+ raise click.ClickException("--attributes must be a JSON object")
141
+
142
+ base_url = None
143
+ if host:
144
+ base_url = _normalize_base_url(host)
145
+
146
+ client = SynapsAI(
147
+ api_key=_resolve_api_key(api_key),
148
+ base_url=base_url,
149
+ timeout=timeout,
150
+ )
151
+
152
+ try:
153
+ results = client.vector_stores.files.upload_paths(
154
+ vector_store_id,
155
+ list(paths),
156
+ attributes=parsed_attributes,
157
+ )
158
+ except (APIError, OSError, ValueError) as exc:
159
+ raise click.ClickException(str(exc)) from exc
160
+
161
+ for item in results:
162
+ click.echo(f"{item.id}\t{item.status}\t{item.usage_bytes}")
163
+
164
+ click.echo(f"Uploaded {len(results)} file(s) to vector store {vector_store_id}")
165
+
166
+
167
+ if __name__ == "__main__":
168
+ main()