polygres-sdk 0.2.0__tar.gz → 0.2.1__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.
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/CONTRIBUTING.md +3 -3
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/PKG-INFO +4 -4
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/README.md +2 -2
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/docs/reference-v1.md +8 -1
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/pyproject.toml +1 -1
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/client.py +2 -1
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/context.py +110 -2
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/models.py +2 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/spec/python-sdk-v1.methods.json +18 -2
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/spec/runtime-v1.openapi.json +313 -5
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/version_notices.py +72 -0
- polygres_sdk-0.2.1/tests/conftest.py +11 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_client.py +17 -2
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_context.py +195 -13
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_method_spec.py +1 -1
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_version.py +6 -6
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_version_notices.py +55 -2
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/generate_sdk_method_spec.py +12 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/runtime_operation_exclusions.json +12 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/.gitignore +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/LICENSE +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/compatibility/0.1.0/README.md +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/compatibility/0.1.0/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/migrations/README.md +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/migrations/vector-configuration-creation.md +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_api_version.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_method_metadata.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/api_versions.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/api_keys.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/enums.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/errors.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/models.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/ports.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/principals.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/records.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/auth/types.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/context/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/context/enums.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/context/errors.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/context/models.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/context/validation.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/core/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/core/models.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_vendor/polygres_lib/core/types.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/_version.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/context_models.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/context_validation.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/context_wait.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/errors.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/py.typed +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/spec/__init__.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/src/polygres/spec/python-sdk-v1.methods.schema.json +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/fixtures/context/contract-fixtures.json +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_compatibility.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tests/test_packaged_resources.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/check_sdk_compatibility.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/generate_runtime_openapi_snapshot.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/run_context_live_test.sh +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/test_context_live.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/verify_distribution.py +0 -0
- {polygres_sdk-0.2.0 → polygres_sdk-0.2.1}/tools/verify_release_version.py +0 -0
|
@@ -60,7 +60,7 @@ Release rehearsal happens first on TestPyPI:
|
|
|
60
60
|
/tmp/polygres-sdk-testpypi/bin/python -m pip install \
|
|
61
61
|
--index-url https://test.pypi.org/simple/ \
|
|
62
62
|
--extra-index-url https://pypi.org/simple/ \
|
|
63
|
-
polygres-sdk==0.2.
|
|
63
|
+
polygres-sdk==0.2.1
|
|
64
64
|
/tmp/polygres-sdk-testpypi/bin/python - <<'PY'
|
|
65
65
|
import importlib.metadata
|
|
66
66
|
from polygres import Polygres
|
|
@@ -74,8 +74,8 @@ Publish to PyPI only after the same commit has passed TestPyPI validation. Push
|
|
|
74
74
|
a release tag from the public repository:
|
|
75
75
|
|
|
76
76
|
```bash
|
|
77
|
-
git tag polygres-sdk-v0.2.
|
|
78
|
-
git push origin polygres-sdk-v0.2.
|
|
77
|
+
git tag polygres-sdk-v0.2.1
|
|
78
|
+
git push origin polygres-sdk-v0.2.1
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The `pypi` GitHub environment must be approved before the upload proceeds.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: polygres-sdk
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Python SDK for Polygres
|
|
5
5
|
Project-URL: Homepage, https://polygres.com
|
|
6
6
|
Project-URL: Documentation, https://docs.polygres.com/sdk
|
|
@@ -287,11 +287,11 @@ Use a PostgreSQL driver such as psycopg or SQLAlchemy when your application need
|
|
|
287
287
|
|
|
288
288
|
## Version and support
|
|
289
289
|
|
|
290
|
-
Package version: [`0.2.
|
|
290
|
+
Package version: [`0.2.1`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.2.1).
|
|
291
291
|
|
|
292
292
|
When contacting support, include the installed SDK version and the request ID.
|
|
293
293
|
|
|
294
|
-
See the [SDK 0.2.
|
|
294
|
+
See the [SDK 0.2.1 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.2.1) for release changes.
|
|
295
295
|
|
|
296
296
|
## Optional Agent Skill
|
|
297
297
|
|
|
@@ -245,11 +245,11 @@ Use a PostgreSQL driver such as psycopg or SQLAlchemy when your application need
|
|
|
245
245
|
|
|
246
246
|
## Version and support
|
|
247
247
|
|
|
248
|
-
Package version: [`0.2.
|
|
248
|
+
Package version: [`0.2.1`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.2.1).
|
|
249
249
|
|
|
250
250
|
When contacting support, include the installed SDK version and the request ID.
|
|
251
251
|
|
|
252
|
-
See the [SDK 0.2.
|
|
252
|
+
See the [SDK 0.2.1 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.2.1) for release changes.
|
|
253
253
|
|
|
254
254
|
## Optional Agent Skill
|
|
255
255
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This file is generated. Edit Python method metadata, docstrings, or the Runtime OpenAPI contract instead.
|
|
4
4
|
|
|
5
|
-
- SDK package version: `0.2.
|
|
5
|
+
- SDK package version: `0.2.1`
|
|
6
6
|
- HTTP API family: `v1`
|
|
7
7
|
- Default API behavior version: `2026-08-04`
|
|
8
8
|
- Method specification schema: `1`
|
|
@@ -190,6 +190,13 @@ Return pgContext capabilities for this Runtime.
|
|
|
190
190
|
capabilities = project.context.get_capabilities()
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
+
Context retrieval methods fetch this response lazily on their first call and
|
|
194
|
+
cache it on the project Context namespace. They validate the requested mode,
|
|
195
|
+
dimensions, result and candidate limits, graph depth, and relationship-type
|
|
196
|
+
count before sending the retrieval request. Calling `get_capabilities()`
|
|
197
|
+
explicitly refreshes the cache. Cached capabilities expire after 60 seconds,
|
|
198
|
+
and an unavailable capability is refreshed on the next attempted call.
|
|
199
|
+
|
|
193
200
|
### `project.context.get_collection()`
|
|
194
201
|
|
|
195
202
|
Return one Context collection by UUID.
|
|
@@ -42,7 +42,7 @@ from polygres.models import (
|
|
|
42
42
|
TextResult,
|
|
43
43
|
VectorResult,
|
|
44
44
|
)
|
|
45
|
-
from polygres.version_notices import emit_version_notice
|
|
45
|
+
from polygres.version_notices import check_central_version_notices, emit_version_notice
|
|
46
46
|
|
|
47
47
|
PROJECT_RE = re.compile(r"^p[a-z0-9]{23}$")
|
|
48
48
|
RETRY_STATUSES = {408, 429, 500, 502, 503, 504}
|
|
@@ -350,6 +350,7 @@ class Polygres:
|
|
|
350
350
|
if deadline is not None and time.monotonic() >= deadline:
|
|
351
351
|
raise _deadline_error(method, path)
|
|
352
352
|
emit_version_notice(response.headers, current_version=__version__)
|
|
353
|
+
check_central_version_notices(current_version=__version__)
|
|
353
354
|
if error is not None:
|
|
354
355
|
raise error
|
|
355
356
|
payload = response.json()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import time
|
|
4
|
+
from dataclasses import dataclass, field
|
|
4
5
|
from enum import Enum
|
|
5
6
|
from typing import TYPE_CHECKING, Any, TypeVar
|
|
6
7
|
from uuid import UUID
|
|
@@ -74,14 +75,28 @@ if TYPE_CHECKING:
|
|
|
74
75
|
ResponseT = TypeVar("ResponseT", bound=BaseModel)
|
|
75
76
|
RequestTimeout = float | httpx.Timeout | None
|
|
76
77
|
_UNSET = object()
|
|
78
|
+
_CAPABILITY_CACHE_TTL_SECONDS = 60.0
|
|
77
79
|
|
|
78
80
|
|
|
79
81
|
@dataclass
|
|
80
82
|
class ContextNamespace:
|
|
81
83
|
_project: Project
|
|
84
|
+
_capabilities_cache: CapabilitiesResponse | None = field(
|
|
85
|
+
init=False,
|
|
86
|
+
default=None,
|
|
87
|
+
repr=False,
|
|
88
|
+
)
|
|
89
|
+
_capabilities_cached_at: float | None = field(init=False, default=None, repr=False)
|
|
82
90
|
|
|
83
91
|
def get_capabilities(self, *, timeout: RequestTimeout = None) -> CapabilitiesResponse:
|
|
84
|
-
|
|
92
|
+
capabilities = self._get_model(
|
|
93
|
+
"/context/capabilities",
|
|
94
|
+
CapabilitiesResponse,
|
|
95
|
+
timeout=timeout,
|
|
96
|
+
)
|
|
97
|
+
self._capabilities_cache = capabilities
|
|
98
|
+
self._capabilities_cached_at = time.monotonic()
|
|
99
|
+
return capabilities
|
|
85
100
|
|
|
86
101
|
def get_onboarding(self, *, timeout: RequestTimeout = None) -> ContextOnboardingResponse:
|
|
87
102
|
"""Return cached pgContext onboarding state without running discovery."""
|
|
@@ -459,6 +474,7 @@ class ContextNamespace:
|
|
|
459
474
|
) -> Page[PointMapping]:
|
|
460
475
|
collection_uuid = context_uuid(collection_id, field="collection_id")
|
|
461
476
|
_page_limit(limit, field="limit")
|
|
477
|
+
self._validate_capability_request("point_scroll", {}, timeout=timeout)
|
|
462
478
|
response = self._get_model(
|
|
463
479
|
f"/context/collections/{collection_uuid}/points",
|
|
464
480
|
PointScrollResponse,
|
|
@@ -670,6 +686,7 @@ class ContextNamespace:
|
|
|
670
686
|
CountRequest,
|
|
671
687
|
{"collection": context_collection(collection), "filter": filter},
|
|
672
688
|
)
|
|
689
|
+
self._validate_capability_request("count", payload, timeout=timeout)
|
|
673
690
|
return self._post_model(
|
|
674
691
|
"/context/count", payload, CountResponse, timeout=timeout, retryable=True
|
|
675
692
|
)
|
|
@@ -692,6 +709,12 @@ class ContextNamespace:
|
|
|
692
709
|
"limit": limit,
|
|
693
710
|
},
|
|
694
711
|
)
|
|
712
|
+
self._validate_capability_request(
|
|
713
|
+
"facets",
|
|
714
|
+
payload,
|
|
715
|
+
timeout=timeout,
|
|
716
|
+
validate_limits=False,
|
|
717
|
+
)
|
|
695
718
|
return self._post_model(
|
|
696
719
|
"/context/facets", payload, FacetsResponse, timeout=timeout, retryable=True
|
|
697
720
|
)
|
|
@@ -708,6 +731,7 @@ class ContextNamespace:
|
|
|
708
731
|
) -> RankedResponse:
|
|
709
732
|
return self._ranked(
|
|
710
733
|
"/context/search",
|
|
734
|
+
"dense_search",
|
|
711
735
|
DenseSearchRequest,
|
|
712
736
|
{
|
|
713
737
|
"collection": context_collection(collection),
|
|
@@ -732,6 +756,7 @@ class ContextNamespace:
|
|
|
732
756
|
) -> RankedResponse:
|
|
733
757
|
return self._ranked(
|
|
734
758
|
"/context/grouped-search",
|
|
759
|
+
"grouped_search",
|
|
735
760
|
GroupedSearchRequest,
|
|
736
761
|
{
|
|
737
762
|
"collection": context_collection(collection),
|
|
@@ -766,6 +791,7 @@ class ContextNamespace:
|
|
|
766
791
|
"minimum_recall": minimum_recall,
|
|
767
792
|
},
|
|
768
793
|
)
|
|
794
|
+
self._validate_capability_request("recall_check", payload, timeout=timeout)
|
|
769
795
|
return self._post_model(
|
|
770
796
|
"/context/recall-check",
|
|
771
797
|
payload,
|
|
@@ -786,6 +812,7 @@ class ContextNamespace:
|
|
|
786
812
|
) -> RankedResponse:
|
|
787
813
|
return self._ranked(
|
|
788
814
|
"/context/hybrid/text",
|
|
815
|
+
"text_hybrid",
|
|
789
816
|
TextHybridSearchRequest,
|
|
790
817
|
{
|
|
791
818
|
"collection": context_collection(collection),
|
|
@@ -814,6 +841,7 @@ class ContextNamespace:
|
|
|
814
841
|
) -> RankedResponse:
|
|
815
842
|
return self._ranked(
|
|
816
843
|
"/context/hybrid/graph-first",
|
|
844
|
+
"graph_first",
|
|
817
845
|
GraphFirstSearchRequest,
|
|
818
846
|
{
|
|
819
847
|
"collection": context_collection(collection),
|
|
@@ -847,6 +875,7 @@ class ContextNamespace:
|
|
|
847
875
|
) -> RankedResponse:
|
|
848
876
|
return self._ranked(
|
|
849
877
|
"/context/hybrid/vector-first",
|
|
878
|
+
"vector_first",
|
|
850
879
|
VectorFirstSearchRequest,
|
|
851
880
|
{
|
|
852
881
|
"collection": context_collection(collection),
|
|
@@ -883,6 +912,7 @@ class ContextNamespace:
|
|
|
883
912
|
) -> RankedResponse:
|
|
884
913
|
return self._ranked(
|
|
885
914
|
"/context/hybrid/rank-fusion",
|
|
915
|
+
"rank_fusion",
|
|
886
916
|
RankFusionSearchRequest,
|
|
887
917
|
{
|
|
888
918
|
"collection": context_collection(collection),
|
|
@@ -947,6 +977,7 @@ class ContextNamespace:
|
|
|
947
977
|
"limit": limit,
|
|
948
978
|
},
|
|
949
979
|
)
|
|
980
|
+
self._validate_capability_request("joint", payload, timeout=timeout)
|
|
950
981
|
return self._post_model(
|
|
951
982
|
"/context/hybrid/joint",
|
|
952
983
|
payload,
|
|
@@ -1010,13 +1041,43 @@ class ContextNamespace:
|
|
|
1010
1041
|
def _ranked(
|
|
1011
1042
|
self,
|
|
1012
1043
|
path: str,
|
|
1044
|
+
capability: str,
|
|
1013
1045
|
request_model: type[BaseModel],
|
|
1014
1046
|
request: dict[str, Any],
|
|
1015
1047
|
timeout: RequestTimeout,
|
|
1016
1048
|
) -> RankedResponse:
|
|
1017
1049
|
_, payload = context_model(request_model, request)
|
|
1050
|
+
self._validate_capability_request(capability, payload, timeout=timeout)
|
|
1018
1051
|
return self._post_model(path, payload, RankedResponse, timeout=timeout, retryable=False)
|
|
1019
1052
|
|
|
1053
|
+
def _validate_capability_request(
|
|
1054
|
+
self,
|
|
1055
|
+
capability: str,
|
|
1056
|
+
payload: dict[str, Any],
|
|
1057
|
+
*,
|
|
1058
|
+
timeout: RequestTimeout,
|
|
1059
|
+
validate_limits: bool = True,
|
|
1060
|
+
) -> None:
|
|
1061
|
+
capabilities = self._capabilities_cache
|
|
1062
|
+
cached_at = self._capabilities_cached_at
|
|
1063
|
+
expired = cached_at is None or time.monotonic() - cached_at >= _CAPABILITY_CACHE_TTL_SECONDS
|
|
1064
|
+
if capabilities is None or expired or not bool(getattr(capabilities, capability)):
|
|
1065
|
+
capabilities = self.get_capabilities(timeout=timeout)
|
|
1066
|
+
if not bool(getattr(capabilities, capability)):
|
|
1067
|
+
blocker = getattr(capabilities, f"{capability}_blocker")
|
|
1068
|
+
blocker_message = getattr(
|
|
1069
|
+
capabilities,
|
|
1070
|
+
f"{capability}_blocker_message",
|
|
1071
|
+
None,
|
|
1072
|
+
)
|
|
1073
|
+
raise PolygresValidationError(
|
|
1074
|
+
blocker_message or f"Context {capability.replace('_', ' ')} is unavailable.",
|
|
1075
|
+
code="CONTEXT_CAPABILITY_UNAVAILABLE",
|
|
1076
|
+
details={"capability": capability, "blocker": blocker},
|
|
1077
|
+
)
|
|
1078
|
+
if validate_limits:
|
|
1079
|
+
_validate_capability_limits(capabilities, payload)
|
|
1080
|
+
|
|
1020
1081
|
def _get_model(
|
|
1021
1082
|
self,
|
|
1022
1083
|
path: str,
|
|
@@ -1061,6 +1122,53 @@ class ContextNamespace:
|
|
|
1061
1122
|
return _operation_response(response)
|
|
1062
1123
|
|
|
1063
1124
|
|
|
1125
|
+
def _validate_capability_limits(
|
|
1126
|
+
capabilities: CapabilitiesResponse,
|
|
1127
|
+
payload: dict[str, Any],
|
|
1128
|
+
) -> None:
|
|
1129
|
+
limit_fields = (
|
|
1130
|
+
("limit", "max_search_limit"),
|
|
1131
|
+
("context_limit", "max_context_limit"),
|
|
1132
|
+
("graph_limit", "max_graph_limit"),
|
|
1133
|
+
("seed_limit", "max_joint_seed_limit"),
|
|
1134
|
+
("traversal_limit", "max_joint_traversal_limit"),
|
|
1135
|
+
("max_depth", "max_graph_depth"),
|
|
1136
|
+
)
|
|
1137
|
+
for field_name, capability_field in limit_fields:
|
|
1138
|
+
value = payload.get(field_name)
|
|
1139
|
+
if value is None:
|
|
1140
|
+
continue
|
|
1141
|
+
maximum = int(getattr(capabilities, capability_field))
|
|
1142
|
+
if int(value) > maximum:
|
|
1143
|
+
raise PolygresValidationError(
|
|
1144
|
+
f"{field_name} must be {maximum} or less for this project",
|
|
1145
|
+
code="CONTEXT_LIMIT_EXCEEDED",
|
|
1146
|
+
details={"field": field_name, "limit": maximum},
|
|
1147
|
+
)
|
|
1148
|
+
|
|
1149
|
+
embedding = payload.get("embedding")
|
|
1150
|
+
if isinstance(embedding, list) and len(embedding) > capabilities.max_dimensions:
|
|
1151
|
+
raise PolygresValidationError(
|
|
1152
|
+
f"embedding must contain at most {capabilities.max_dimensions} dimensions",
|
|
1153
|
+
code="CONTEXT_LIMIT_EXCEEDED",
|
|
1154
|
+
details={"field": "embedding", "limit": capabilities.max_dimensions},
|
|
1155
|
+
)
|
|
1156
|
+
|
|
1157
|
+
relationship_types = payload.get("relationship_types")
|
|
1158
|
+
if (
|
|
1159
|
+
isinstance(relationship_types, list)
|
|
1160
|
+
and len(relationship_types) > capabilities.max_relationship_types
|
|
1161
|
+
):
|
|
1162
|
+
raise PolygresValidationError(
|
|
1163
|
+
"relationship_types exceeds this project's capability limit",
|
|
1164
|
+
code="CONTEXT_LIMIT_EXCEEDED",
|
|
1165
|
+
details={
|
|
1166
|
+
"field": "relationship_types",
|
|
1167
|
+
"limit": capabilities.max_relationship_types,
|
|
1168
|
+
},
|
|
1169
|
+
)
|
|
1170
|
+
|
|
1171
|
+
|
|
1064
1172
|
def _attach_context_method_metadata() -> None:
|
|
1065
1173
|
bindings = (
|
|
1066
1174
|
(
|
|
@@ -248,6 +248,7 @@ class TextResult:
|
|
|
248
248
|
properties: dict[str, Any]
|
|
249
249
|
score: float
|
|
250
250
|
similarity: float | None = None
|
|
251
|
+
key: dict[str, str] | None = None
|
|
251
252
|
|
|
252
253
|
@classmethod
|
|
253
254
|
def from_api(cls, payload: dict[str, Any]) -> TextResult:
|
|
@@ -258,6 +259,7 @@ class TextResult:
|
|
|
258
259
|
properties=dict(payload.get("properties", {})),
|
|
259
260
|
score=float(payload["score"]),
|
|
260
261
|
similarity=payload.get("similarity"),
|
|
262
|
+
key=(dict(payload["key"]) if isinstance(payload.get("key"), dict) else None),
|
|
261
263
|
)
|
|
262
264
|
|
|
263
265
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -178,6 +178,14 @@
|
|
|
178
178
|
"reason": "Readiness checks are operational endpoints; the SDK uses retrieval readiness instead.",
|
|
179
179
|
"review_date": "2027-02-04"
|
|
180
180
|
},
|
|
181
|
+
{
|
|
182
|
+
"method": "POST",
|
|
183
|
+
"operation_id": "reindex_text_configuration_v1_text_configurations__config_id__reindex_post",
|
|
184
|
+
"owner": "Runtime Platform",
|
|
185
|
+
"path": "/v1/text/configurations/{config_id}/reindex",
|
|
186
|
+
"reason": "Text reindexing is a setup operation managed outside the retrieval SDK.",
|
|
187
|
+
"review_date": "2027-02-04"
|
|
188
|
+
},
|
|
181
189
|
{
|
|
182
190
|
"method": "POST",
|
|
183
191
|
"operation_id": "reindex_vector_configuration_v1_vector_configurations__config_id__reindex_post",
|
|
@@ -201,6 +209,14 @@
|
|
|
201
209
|
"path": "/v1/vector/configurations/{config_id}/compatibility-engine/{target_engine}",
|
|
202
210
|
"reason": "Per-configuration compatibility engine selection is an operator rollback control, not an application retrieval method.",
|
|
203
211
|
"review_date": "2027-02-04"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"method": "GET",
|
|
215
|
+
"operation_id": "text_configuration_diagnostics_v1_text_configurations__config_id__diagnostics_get",
|
|
216
|
+
"owner": "Runtime Platform",
|
|
217
|
+
"path": "/v1/text/configurations/{config_id}/diagnostics",
|
|
218
|
+
"reason": "Text index diagnostics are managed through the dashboard and control-plane workflow.",
|
|
219
|
+
"review_date": "2027-02-04"
|
|
204
220
|
}
|
|
205
221
|
],
|
|
206
222
|
"methods": [
|
|
@@ -4438,8 +4454,8 @@
|
|
|
4438
4454
|
"stability": "stable"
|
|
4439
4455
|
}
|
|
4440
4456
|
],
|
|
4441
|
-
"openapi_sha256": "
|
|
4457
|
+
"openapi_sha256": "7a0960535e680ffd590776b2f6fea4188cb857c75bf5f5568680e6189f746b5f",
|
|
4442
4458
|
"schema_version": 1,
|
|
4443
4459
|
"sdk": "polygres-sdk",
|
|
4444
|
-
"sdk_version": "0.2.
|
|
4460
|
+
"sdk_version": "0.2.1"
|
|
4445
4461
|
}
|