matrx-api 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 (66) hide show
  1. {matrx_api-0.1.0 → matrx_api-0.1.2}/PKG-INFO +8 -2
  2. {matrx_api-0.1.0 → matrx_api-0.1.2}/README.md +5 -0
  3. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/client.py +13 -2
  4. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/deployments.py +1 -1
  5. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/errors.py +2 -0
  6. matrx_api-0.1.2/matrx_api/generated/account.py +2553 -0
  7. matrx_api-0.1.2/matrx_api/generated/agents.py +3728 -0
  8. matrx_api-0.1.2/matrx_api/generated/ai.py +479 -0
  9. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/generated/apps.py +376 -60
  10. matrx_api-0.1.2/matrx_api/generated/architecture.py +4158 -0
  11. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/generated/audio.py +304 -37
  12. matrx_api-0.1.2/matrx_api/generated/chat.py +2524 -0
  13. matrx_api-0.1.2/matrx_api/generated/code.py +2309 -0
  14. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/generated/commerce.py +13 -3
  15. matrx_api-0.1.2/matrx_api/generated/communications.py +1081 -0
  16. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/generated/computer.py +455 -19
  17. matrx_api-0.1.2/matrx_api/generated/content.py +1386 -0
  18. matrx_api-0.1.2/matrx_api/generated/crm.py +1434 -0
  19. matrx_api-0.1.2/matrx_api/generated/data.py +1784 -0
  20. matrx_api-0.1.2/matrx_api/generated/education.py +71 -0
  21. matrx_api-0.1.2/matrx_api/generated/files.py +4299 -0
  22. matrx_api-0.1.2/matrx_api/generated/human_resources.py +981 -0
  23. matrx_api-0.1.2/matrx_api/generated/integrations.py +18896 -0
  24. matrx_api-0.1.2/matrx_api/generated/intelligence.py +3464 -0
  25. matrx_api-0.1.2/matrx_api/generated/knowledge.py +4339 -0
  26. matrx_api-0.1.2/matrx_api/generated/legal.py +933 -0
  27. matrx_api-0.1.2/matrx_api/generated/marketing.py +7432 -0
  28. matrx_api-0.1.2/matrx_api/generated/masterwork.py +1537 -0
  29. matrx_api-0.1.2/matrx_api/generated/media.py +1922 -0
  30. matrx_api-0.1.2/matrx_api/generated/platform.py +534 -0
  31. matrx_api-0.1.2/matrx_api/generated/publish.py +1239 -0
  32. matrx_api-0.1.2/matrx_api/generated/web.py +4389 -0
  33. matrx_api-0.1.2/matrx_api/generated/workflows.py +3695 -0
  34. {matrx_api-0.1.0 → matrx_api-0.1.2}/pyproject.toml +3 -2
  35. {matrx_api-0.1.0 → matrx_api-0.1.2}/scripts/generate.py +149 -8
  36. {matrx_api-0.1.0 → matrx_api-0.1.2}/tests/test_client.py +53 -0
  37. matrx_api-0.1.0/matrx_api/generated/account.py +0 -1110
  38. matrx_api-0.1.0/matrx_api/generated/agents.py +0 -1000
  39. matrx_api-0.1.0/matrx_api/generated/ai.py +0 -181
  40. matrx_api-0.1.0/matrx_api/generated/architecture.py +0 -2071
  41. matrx_api-0.1.0/matrx_api/generated/chat.py +0 -900
  42. matrx_api-0.1.0/matrx_api/generated/code.py +0 -951
  43. matrx_api-0.1.0/matrx_api/generated/communications.py +0 -460
  44. matrx_api-0.1.0/matrx_api/generated/content.py +0 -700
  45. matrx_api-0.1.0/matrx_api/generated/crm.py +0 -440
  46. matrx_api-0.1.0/matrx_api/generated/data.py +0 -630
  47. matrx_api-0.1.0/matrx_api/generated/education.py +0 -40
  48. matrx_api-0.1.0/matrx_api/generated/files.py +0 -2261
  49. matrx_api-0.1.0/matrx_api/generated/human_resources.py +0 -290
  50. matrx_api-0.1.0/matrx_api/generated/integrations.py +0 -8920
  51. matrx_api-0.1.0/matrx_api/generated/intelligence.py +0 -1000
  52. matrx_api-0.1.0/matrx_api/generated/knowledge.py +0 -1910
  53. matrx_api-0.1.0/matrx_api/generated/legal.py +0 -370
  54. matrx_api-0.1.0/matrx_api/generated/marketing.py +0 -2300
  55. matrx_api-0.1.0/matrx_api/generated/masterwork.py +0 -510
  56. matrx_api-0.1.0/matrx_api/generated/media.py +0 -1021
  57. matrx_api-0.1.0/matrx_api/generated/platform.py +0 -250
  58. matrx_api-0.1.0/matrx_api/generated/publish.py +0 -410
  59. matrx_api-0.1.0/matrx_api/generated/web.py +0 -1771
  60. matrx_api-0.1.0/matrx_api/generated/workflows.py +0 -1411
  61. {matrx_api-0.1.0 → matrx_api-0.1.2}/.gitignore +0 -0
  62. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/__init__.py +0 -0
  63. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/credentials.py +0 -0
  64. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/generated/__init__.py +0 -0
  65. {matrx_api-0.1.0 → matrx_api-0.1.2}/matrx_api/streams.py +0 -0
  66. {matrx_api-0.1.0 → matrx_api-0.1.2}/tests/conftest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: matrx-api
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Python client for every AI Matrx server, generated from the language-neutral server contract (sister of @ai-matrx/api)
5
5
  Author-email: Matrx <admin@aimatrx.com>
6
6
  License: MIT
@@ -9,8 +9,9 @@ Classifier: Development Status :: 3 - Alpha
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.11
12
13
  Classifier: Programming Language :: Python :: 3.13
13
- Requires-Python: >=3.13
14
+ Requires-Python: >=3.11
14
15
  Requires-Dist: httpx>=0.27
15
16
  Description-Content-Type: text/markdown
16
17
 
@@ -40,6 +41,11 @@ before the wire; exempt never sends one); unique `X-Request-Id`; GET/HEAD retry
40
41
  failure, writes never; one `MatrxApiError(status, code, message)`; NDJSON/SSE/bytes streams as async
41
42
  iterators (`*_or_json` operations return `JsonOrStream`).
42
43
 
44
+ Per-schema types: every generated domain module exports the contract's request/response schemas as
45
+ `TypedDict`s (`files.TYPES`) and annotates `body=` / the return with them. `route_prefix=` (a string for
46
+ every deployment, or `{deployment: prefix}`) is prepended to every path for callers that mount under a prefix.
47
+ Installs on Python >=3.11.
48
+
43
49
  ## Regenerate
44
50
 
45
51
  ```
@@ -24,6 +24,11 @@ before the wire; exempt never sends one); unique `X-Request-Id`; GET/HEAD retry
24
24
  failure, writes never; one `MatrxApiError(status, code, message)`; NDJSON/SSE/bytes streams as async
25
25
  iterators (`*_or_json` operations return `JsonOrStream`).
26
26
 
27
+ Per-schema types: every generated domain module exports the contract's request/response schemas as
28
+ `TypedDict`s (`files.TYPES`) and annotates `body=` / the return with them. `route_prefix=` (a string for
29
+ every deployment, or `{deployment: prefix}`) is prepended to every path for callers that mount under a prefix.
30
+ Installs on Python >=3.11.
31
+
27
32
  ## Regenerate
28
33
 
29
34
  ```
@@ -182,6 +182,7 @@ class MatrxApi:
182
182
  environment: Environment = "production",
183
183
  base_urls: Mapping[str, str] | None = None,
184
184
  resolve_base_url: Callable[[str, OperationDescriptor], str | None] | None = None,
185
+ route_prefix: str | Mapping[str, str] | None = None,
185
186
  http_client: httpx.AsyncClient | None = None,
186
187
  transport: httpx.AsyncBaseTransport | None = None,
187
188
  connect_timeout: float = DEFAULT_CONNECT_TIMEOUT,
@@ -198,6 +199,7 @@ class MatrxApi:
198
199
  self._environment = environment
199
200
  self._base_urls = dict(base_urls or {})
200
201
  self._resolve_base_url = resolve_base_url
202
+ self._route_prefix = route_prefix
201
203
  self._owns_client = http_client is None
202
204
  self._client = http_client or httpx.AsyncClient(transport=transport, follow_redirects=False)
203
205
  self._connect_timeout = connect_timeout
@@ -239,8 +241,15 @@ class MatrxApi:
239
241
  )
240
242
  return fallback
241
243
 
244
+ def prefix(self, op: OperationDescriptor) -> str:
245
+ """The path prefix for ``op``'s deployment: one string for every deployment, or a per-deployment map."""
246
+ rp = self._route_prefix
247
+ raw = rp.get(op.deployment) if isinstance(rp, Mapping) else rp
248
+ raw = (raw or "").strip().strip("/")
249
+ return f"/{raw}" if raw else ""
250
+
242
251
  def url(self, op: OperationDescriptor, *, path: Mapping[str, Any] | None = None) -> str:
243
- return f"{self.base_url(op)}{_interpolate(op.path, path)}"
252
+ return f"{self.base_url(op)}{self.prefix(op)}{_interpolate(op.path, path)}"
244
253
 
245
254
  def _organization_for(self, op: OperationDescriptor, options: CallOptions | None) -> str | None:
246
255
  if op.org == "exempt":
@@ -329,7 +338,9 @@ class MatrxApi:
329
338
  except ValueError:
330
339
  detail = text or None
331
340
  await response.aclose()
332
- return MatrxApiError(status=response.status_code, path=_interpolate(op.path, path), server_detail=detail)
341
+ return MatrxApiError(
342
+ status=response.status_code, path=_interpolate(op.path, path), server_detail=detail, response=response
343
+ )
333
344
 
334
345
  async def send(
335
346
  self,
@@ -1,6 +1,6 @@
1
1
  """GENERATED by matrx-api scripts/generate.py from aidream/api-contract - never edit by hand."""
2
2
 
3
- CONTRACT_SHA256 = '7a09c07daad8cd41c7ae301d9ce90aace006a8f2d3a21dde98885807e5881da5'
3
+ CONTRACT_SHA256 = '605c060bacf38697b876c603bf0260b9b2941fe22b1da1722810724c3d0c39be'
4
4
 
5
5
  # Which deployment answers (api-deployments.json): default base URLs and the env names that override them.
6
6
  DEPLOYMENTS: dict[str, dict] = {
@@ -70,7 +70,9 @@ class MatrxApiError(Exception):
70
70
  server_detail: Any = None,
71
71
  message: str | None = None,
72
72
  code: str | None = None,
73
+ response: Any = None,
73
74
  ) -> None:
75
+ self.response = response # the (already read) httpx.Response of an HTTP failure; None for a transport failure
74
76
  self.status = status
75
77
  self.path = path
76
78
  self.server_detail = server_detail