polygres-sdk 0.4.1__tar.gz → 0.5.0__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.5.0/CHANGELOG.md +127 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/CONTRIBUTING.md +4 -4
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/PKG-INFO +61 -3
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/README.md +60 -2
- polygres_sdk-0.5.0/compatibility/0.4.1/README.md +7 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/docs/reference-v1.md +91 -1
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/pyproject.toml +2 -1
- polygres_sdk-0.5.0/src/polygres/_query_input.py +50 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/enums.py +78 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/models.py +2 -1
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/ports.py +11 -1
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/principals.py +4 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/context/models.py +120 -18
- polygres_sdk-0.5.0/src/polygres/_vendor/polygres_lib/embeddings/models.py +365 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/errors/catalog.py +19 -2
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/errors/generated.py +1594 -10
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/client.py +77 -12
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/context.py +121 -18
- polygres_sdk-0.5.0/src/polygres/spec/python-sdk-v1.methods.json +8191 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/spec/runtime-v1.openapi.json +7145 -4652
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/fixtures/context/contract-fixtures.json +26 -1
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_client.py +3 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_context.py +18 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_method_spec.py +1 -1
- polygres_sdk-0.5.0/tests/test_public_surface.py +15 -0
- polygres_sdk-0.5.0/tests/test_query_embeddings.py +164 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_release_workflow.py +3 -3
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_version.py +6 -6
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_version_notices.py +9 -9
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/generate_sdk_method_spec.py +27 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/runtime_operation_exclusions.json +72 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/verify_distribution.py +3 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/.gitignore +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/LICENSE +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.1.0/README.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.1.0/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.2.1/README.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.2.1/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.3.0/README.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/compatibility/0.3.0/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.4.1/src/polygres/spec → polygres_sdk-0.5.0/compatibility/0.4.1}/python-sdk-v1.methods.json +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/migrations/README.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/migrations/pgcontext-0.2.0-names.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/migrations/vector-configuration-creation.md +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_api_version.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_method_metadata.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/api_versions.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/api_keys.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/errors.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/records.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/auth/types.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/context/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/context/enums.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/context/errors.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/context/validation.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/core/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/core/models.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/core/types.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_vendor/polygres_lib/errors/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/_version.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/context_models.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/context_validation.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/context_wait.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/errors.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/models.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/py.typed +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/rows.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/spec/__init__.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/spec/pgcontext-0.2.0-compatibility.json +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/spec/python-sdk-v1.methods.schema.json +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/src/polygres/version_notices.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/conftest.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_compatibility.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_packaged_resources.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tests/test_rows.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/check_pgcontext_compatibility.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/check_sdk_compatibility.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/extract_release_notes.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/generate_runtime_openapi_snapshot.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/run_context_live_test.sh +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/test_context_live.py +0 -0
- {polygres_sdk-0.4.1 → polygres_sdk-0.5.0}/tools/verify_release_version.py +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `polygres-sdk` are documented in this file.
|
|
4
|
+
|
|
5
|
+
## Unreleased
|
|
6
|
+
|
|
7
|
+
## 0.5.0 - 2026-09-12
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Pass text to existing Context, vector, and hybrid searches to generate query
|
|
12
|
+
embeddings with the configured model. Existing vector calls retain their
|
|
13
|
+
arguments and response types.
|
|
14
|
+
- Build nearest query-plan branches with text and embed them during execution.
|
|
15
|
+
- Control query credit usage and reuse embedding attempts across retries and
|
|
16
|
+
paginated results with idempotency keys.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Refresh the packaged Runtime API reference and validate compatibility against
|
|
22
|
+
the published SDK 0.4.1 contract.
|
|
23
|
+
- Include the changelog in source distributions.
|
|
24
|
+
|
|
25
|
+
Existing SDK methods and query-vector workflows remain available. Configure
|
|
26
|
+
embedding generation through the dashboard, CLI, or MCP.
|
|
27
|
+
|
|
28
|
+
## 0.4.1 - 2026-08-25
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Updated the bundled public error catalog so durable Context collection sync,
|
|
33
|
+
timeout, connection, memory, storage, and index failures use their canonical
|
|
34
|
+
messages, statuses, retry guidance, and safe recovery details.
|
|
35
|
+
|
|
36
|
+
### Compatibility
|
|
37
|
+
|
|
38
|
+
- Existing SDK methods, signatures, request behavior, and exception classes are
|
|
39
|
+
unchanged from SDK 0.4.0.
|
|
40
|
+
|
|
41
|
+
## 0.4.0 - 2026-08-16
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- Added pgContext 0.2.0-aligned names for vector and filter registration,
|
|
46
|
+
collection deletion, point scrolling, facets, and dense plus full-text
|
|
47
|
+
queries.
|
|
48
|
+
- Added a frozen SDK 0.3.0 method-contract baseline for compatibility checks.
|
|
49
|
+
- Added a pinned, CI-checked pgContext 0.2.0 compatibility inventory that
|
|
50
|
+
records aligned, managed, safely partial, SQL-only, deferred privileged, and
|
|
51
|
+
experimental items with no ambiguous missing stable signatures.
|
|
52
|
+
- Added typed collection aliases, limits, vector configuration, bulk points,
|
|
53
|
+
payload mutation, candidate and raw-vector search, recommendation,
|
|
54
|
+
discovery, exploration, query-plan builders and execution, index
|
|
55
|
+
diagnostics, collection telemetry, query statistics, model versions, and
|
|
56
|
+
embedding migrations.
|
|
57
|
+
- Added additive pgContext compatibility counts to Context capabilities.
|
|
58
|
+
|
|
59
|
+
### Compatibility
|
|
60
|
+
|
|
61
|
+
- Existing SDK 0.3.0 method names remain available with unchanged signatures,
|
|
62
|
+
HTTP requests, response types, exceptions, idempotency, and retry behavior.
|
|
63
|
+
- Aligned names delegate silently to the existing SDK 0.3.0 implementations.
|
|
64
|
+
Upgrading without changing application code does not select new behavior.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- Added synchronized-project mode handling: `connection_info()` raises
|
|
69
|
+
`PolygresPermissionError` with `SYNCED_PROJECT_SURFACE_UNAVAILABLE` while
|
|
70
|
+
readiness, vector, hybrid, graph, text-search, and pgContext stay available.
|
|
71
|
+
|
|
72
|
+
## 0.3.0 - 2026-08-14
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- Added `project.rows.validate()`, `insert()`, `upsert()`, and `ignore()` for
|
|
77
|
+
single-row Runtime writes with typed results and stable validation errors.
|
|
78
|
+
- Added explicit pgContext reconciliation to row writes, including completed,
|
|
79
|
+
pending, and partial-failure outcomes backed by durable operations.
|
|
80
|
+
- Added `PolygresAmbiguousWriteError` for write outcomes that cannot be proven.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Row mutations are sent exactly once. Automatic transport and status retries
|
|
85
|
+
are disabled unless an exact Context-backed idempotency replay is requested.
|
|
86
|
+
|
|
87
|
+
## 0.2.1 - 2026-08-12
|
|
88
|
+
|
|
89
|
+
### Changed
|
|
90
|
+
|
|
91
|
+
- pgContext retrieval methods now check the project's supported operations and
|
|
92
|
+
query limits before sending a request.
|
|
93
|
+
- Capability checks cover result and candidate limits, embedding dimensions,
|
|
94
|
+
graph depth, and relationship-type limits while preserving existing method
|
|
95
|
+
signatures.
|
|
96
|
+
- The bundled Runtime API contract now includes the completed text-search
|
|
97
|
+
configuration and diagnostics operations.
|
|
98
|
+
- Release notices are now checked through the central Polygres API, so future
|
|
99
|
+
SDK update notices no longer require project Runtime API restarts.
|
|
100
|
+
|
|
101
|
+
## 0.2.0 - 2026-08-09
|
|
102
|
+
|
|
103
|
+
### Added
|
|
104
|
+
|
|
105
|
+
- Added the `project.context` namespace for configuring, managing, and querying pgContext collections.
|
|
106
|
+
- Added `PolygresVersionWarning` for available SDK upgrades.
|
|
107
|
+
- Added `PolygresMaintenanceError` so applications can handle maintenance windows separately from other API failures.
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- The retired vector-configuration creation error is exposed as
|
|
112
|
+
`PolygresValidationError` with pgContext replacement details.
|
|
113
|
+
|
|
114
|
+
### Fixed
|
|
115
|
+
|
|
116
|
+
- Improved validation and handling of vector result metrics.
|
|
117
|
+
- Vector queries now correctly handle identifiers using the source table's configured ID types.
|
|
118
|
+
- API errors now provide clearer recovery guidance.
|
|
119
|
+
- Restored Python 3.10 compatibility for retry timing and version-notice date parsing.
|
|
120
|
+
|
|
121
|
+
## 0.1.0 - 2026-07-09
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
|
|
125
|
+
- Initial standalone `polygres-sdk` package.
|
|
126
|
+
- Added Runtime API clients for graph, vector, text, and hybrid retrieval.
|
|
127
|
+
- Added typed results, cursor pagination, automatic page iteration, readiness checks, passwordless connection information, and structured API exceptions.
|
|
@@ -23,7 +23,7 @@ python tools/generate_runtime_openapi_snapshot.py --check
|
|
|
23
23
|
python tools/generate_sdk_method_spec.py --check
|
|
24
24
|
python tools/generate_sdk_method_spec.py --validate-only
|
|
25
25
|
python tools/check_sdk_compatibility.py \
|
|
26
|
-
--baseline compatibility/0.
|
|
26
|
+
--baseline compatibility/0.4.1/python-sdk-v1.methods.json
|
|
27
27
|
python -m build
|
|
28
28
|
python tools/verify_distribution.py dist/*.whl dist/*.tar.gz
|
|
29
29
|
```
|
|
@@ -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.
|
|
63
|
+
polygres-sdk==0.5.0
|
|
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.
|
|
78
|
-
git push origin polygres-sdk-v0.
|
|
77
|
+
git tag polygres-sdk-v0.5.0
|
|
78
|
+
git push origin polygres-sdk-v0.5.0
|
|
79
79
|
```
|
|
80
80
|
|
|
81
81
|
The `pypi` GitHub environment must be approved before the upload proceeds.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: polygres-sdk
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
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
|
|
@@ -114,6 +114,56 @@ New vector setup uses `project.context.create_collection()` with a native
|
|
|
114
114
|
`pgcontext.vector` column. Existing `project.vector` retrieval methods remain available
|
|
115
115
|
for applications using previously registered vector configurations.
|
|
116
116
|
|
|
117
|
+
## Query with text
|
|
118
|
+
|
|
119
|
+
Pass `text` to an existing search method to have Polygres generate the query
|
|
120
|
+
embedding using the model configured for the selected vector:
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
results = project.context.search(
|
|
124
|
+
"articles",
|
|
125
|
+
text="How does replication work?",
|
|
126
|
+
vector_name="content",
|
|
127
|
+
idempotency_key="replication-question-001",
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
for result in results.results:
|
|
131
|
+
print(result.properties)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Omit `vector_name` to use the collection's default vector. Set up generation
|
|
135
|
+
and the linked collection through the dashboard, CLI, or MCP first. The
|
|
136
|
+
selected vector must have an unambiguous association with its embedding model.
|
|
137
|
+
|
|
138
|
+
Existing calls that pass `embedding` continue to work. Supply either text or a
|
|
139
|
+
vector. For `context.query()` and `context.text_hybrid()`, omit the embedding
|
|
140
|
+
to generate it from the existing `query` argument:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
results = project.context.query("articles", query="replication failures")
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Text input is also available on Context grouped, candidate, graph-first,
|
|
147
|
+
vector-first, rank-fusion, and joint searches, plus `vector.search()` and the
|
|
148
|
+
`hybrid` query methods. On `context.joint()`, `text` supplies the semantic input
|
|
149
|
+
and `query` remains the separate lexical input. Responses retain their existing
|
|
150
|
+
types, filters, ranking options, and pagination behavior.
|
|
151
|
+
|
|
152
|
+
For query plans, build `context.query_nearest(text="replication")` and pass the
|
|
153
|
+
plan to `context.execute_query()`. The builder makes no network requests;
|
|
154
|
+
generation happens during execution.
|
|
155
|
+
|
|
156
|
+
Text queries use the project's query embedding allowance. Organization credits
|
|
157
|
+
are used only with `use_credits=True` and project spending permission. Passing
|
|
158
|
+
an explicit vector does not consume embedding allowance. Reuse an idempotency
|
|
159
|
+
key when retrying the same query across separate calls. Automatic retries and
|
|
160
|
+
pagination reuse the original embedding attempt. Set `timeout` to control the
|
|
161
|
+
request budget, including embedding generation. Query plans accept credit,
|
|
162
|
+
idempotency, and timeout options on `execute_query()`.
|
|
163
|
+
|
|
164
|
+
This requires a Runtime that supports query embedding generation. SDK 0.5.0
|
|
165
|
+
checks that support before sending text queries.
|
|
166
|
+
|
|
117
167
|
## pgContext-aligned names
|
|
118
168
|
|
|
119
169
|
SDK 0.4.0 adds pgContext 0.2.0 terminology while keeping every SDK 0.3.0
|
|
@@ -365,11 +415,11 @@ payload and idempotency key.
|
|
|
365
415
|
|
|
366
416
|
## Version and support
|
|
367
417
|
|
|
368
|
-
Package version: [`0.
|
|
418
|
+
Package version: [`0.5.0`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.5.0).
|
|
369
419
|
|
|
370
420
|
When contacting support, include the installed SDK version and the request ID.
|
|
371
421
|
|
|
372
|
-
See the [SDK 0.
|
|
422
|
+
See the [SDK 0.5.0 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.5.0) for release changes.
|
|
373
423
|
|
|
374
424
|
## Optional Agent Skill
|
|
375
425
|
|
|
@@ -380,3 +430,11 @@ npx skills add Evokoa/polygres-skills --skill polygres-sdk
|
|
|
380
430
|
```
|
|
381
431
|
|
|
382
432
|
See the [Agent Skills repository](https://github.com/Evokoa/polygres-skills) for Codex and Claude Code installation options.
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
## Managed automatic embeddings
|
|
436
|
+
|
|
437
|
+
Configure watched text, optionally reuse compatible existing vectors, and generate
|
|
438
|
+
query embeddings with the pinned model. See the [automatic embeddings guide](https://docs.polygres.com/platform/automatic-embeddings) for preview, creation,
|
|
439
|
+
processing, Context handoff, quotas, and recovery. Availability requires an enabled
|
|
440
|
+
model catalog and quota policy in the connected environment.
|
|
@@ -72,6 +72,56 @@ New vector setup uses `project.context.create_collection()` with a native
|
|
|
72
72
|
`pgcontext.vector` column. Existing `project.vector` retrieval methods remain available
|
|
73
73
|
for applications using previously registered vector configurations.
|
|
74
74
|
|
|
75
|
+
## Query with text
|
|
76
|
+
|
|
77
|
+
Pass `text` to an existing search method to have Polygres generate the query
|
|
78
|
+
embedding using the model configured for the selected vector:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
results = project.context.search(
|
|
82
|
+
"articles",
|
|
83
|
+
text="How does replication work?",
|
|
84
|
+
vector_name="content",
|
|
85
|
+
idempotency_key="replication-question-001",
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
for result in results.results:
|
|
89
|
+
print(result.properties)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Omit `vector_name` to use the collection's default vector. Set up generation
|
|
93
|
+
and the linked collection through the dashboard, CLI, or MCP first. The
|
|
94
|
+
selected vector must have an unambiguous association with its embedding model.
|
|
95
|
+
|
|
96
|
+
Existing calls that pass `embedding` continue to work. Supply either text or a
|
|
97
|
+
vector. For `context.query()` and `context.text_hybrid()`, omit the embedding
|
|
98
|
+
to generate it from the existing `query` argument:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
results = project.context.query("articles", query="replication failures")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Text input is also available on Context grouped, candidate, graph-first,
|
|
105
|
+
vector-first, rank-fusion, and joint searches, plus `vector.search()` and the
|
|
106
|
+
`hybrid` query methods. On `context.joint()`, `text` supplies the semantic input
|
|
107
|
+
and `query` remains the separate lexical input. Responses retain their existing
|
|
108
|
+
types, filters, ranking options, and pagination behavior.
|
|
109
|
+
|
|
110
|
+
For query plans, build `context.query_nearest(text="replication")` and pass the
|
|
111
|
+
plan to `context.execute_query()`. The builder makes no network requests;
|
|
112
|
+
generation happens during execution.
|
|
113
|
+
|
|
114
|
+
Text queries use the project's query embedding allowance. Organization credits
|
|
115
|
+
are used only with `use_credits=True` and project spending permission. Passing
|
|
116
|
+
an explicit vector does not consume embedding allowance. Reuse an idempotency
|
|
117
|
+
key when retrying the same query across separate calls. Automatic retries and
|
|
118
|
+
pagination reuse the original embedding attempt. Set `timeout` to control the
|
|
119
|
+
request budget, including embedding generation. Query plans accept credit,
|
|
120
|
+
idempotency, and timeout options on `execute_query()`.
|
|
121
|
+
|
|
122
|
+
This requires a Runtime that supports query embedding generation. SDK 0.5.0
|
|
123
|
+
checks that support before sending text queries.
|
|
124
|
+
|
|
75
125
|
## pgContext-aligned names
|
|
76
126
|
|
|
77
127
|
SDK 0.4.0 adds pgContext 0.2.0 terminology while keeping every SDK 0.3.0
|
|
@@ -323,11 +373,11 @@ payload and idempotency key.
|
|
|
323
373
|
|
|
324
374
|
## Version and support
|
|
325
375
|
|
|
326
|
-
Package version: [`0.
|
|
376
|
+
Package version: [`0.5.0`](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.5.0).
|
|
327
377
|
|
|
328
378
|
When contacting support, include the installed SDK version and the request ID.
|
|
329
379
|
|
|
330
|
-
See the [SDK 0.
|
|
380
|
+
See the [SDK 0.5.0 release notes](https://github.com/Evokoa/polygres-sdk/releases/tag/polygres-sdk-v0.5.0) for release changes.
|
|
331
381
|
|
|
332
382
|
## Optional Agent Skill
|
|
333
383
|
|
|
@@ -338,3 +388,11 @@ npx skills add Evokoa/polygres-skills --skill polygres-sdk
|
|
|
338
388
|
```
|
|
339
389
|
|
|
340
390
|
See the [Agent Skills repository](https://github.com/Evokoa/polygres-skills) for Codex and Claude Code installation options.
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
## Managed automatic embeddings
|
|
394
|
+
|
|
395
|
+
Configure watched text, optionally reuse compatible existing vectors, and generate
|
|
396
|
+
query embeddings with the pinned model. See the [automatic embeddings guide](https://docs.polygres.com/platform/automatic-embeddings) for preview, creation,
|
|
397
|
+
processing, Context handoff, quotas, and recovery. Availability requires an enabled
|
|
398
|
+
model catalog and quota policy in the connected environment.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# SDK 0.4.1 compatibility baseline
|
|
2
|
+
|
|
3
|
+
Method contract copied unchanged from the published `polygres_sdk-0.4.1-py3-none-any.whl`.
|
|
4
|
+
|
|
5
|
+
Source: https://files.pythonhosted.org/packages/8a/c8/81225a4b8dafbac19b4ad3e5b7643a424655dde444dcdaa7e1626d0ccea0/polygres_sdk-0.4.1-py3-none-any.whl
|
|
6
|
+
|
|
7
|
+
Wheel SHA-256: `5fea5a6cc73c90a44361e6f3200f0554e77d44ab0f4250c4da858633a8f25337`
|
|
@@ -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.
|
|
5
|
+
- SDK package version: `0.5.0`
|
|
6
6
|
- HTTP API family: `v1`
|
|
7
7
|
- Default API behavior version: `2026-08-04`
|
|
8
8
|
- Method specification schema: `1`
|
|
@@ -204,6 +204,12 @@ Search within explicit candidate point IDs.
|
|
|
204
204
|
result = project.context.candidate_search("support", embedding, [1, 2])
|
|
205
205
|
```
|
|
206
206
|
|
|
207
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
208
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
209
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
210
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
211
|
+
See the README's Query with text section for method-specific input rules.
|
|
212
|
+
|
|
207
213
|
### `project.context.clear_payload()`
|
|
208
214
|
|
|
209
215
|
Clear all registered payload fields.
|
|
@@ -388,6 +394,12 @@ Execute a validated pgContext query plan.
|
|
|
388
394
|
results = project.context.execute_query("support", plan)
|
|
389
395
|
```
|
|
390
396
|
|
|
397
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
398
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
399
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
400
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
401
|
+
See the README's Query with text section for method-specific input rules.
|
|
402
|
+
|
|
391
403
|
### `project.context.explain()`
|
|
392
404
|
|
|
393
405
|
Explain the stable dense plus full-text pgContext query.
|
|
@@ -491,6 +503,12 @@ Run graph-first Context hybrid retrieval.
|
|
|
491
503
|
results = project.context.graph_first("support", embedding, start=start)
|
|
492
504
|
```
|
|
493
505
|
|
|
506
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
507
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
508
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
509
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
510
|
+
See the README's Query with text section for method-specific input rules.
|
|
511
|
+
|
|
494
512
|
### `project.context.grouped_search()`
|
|
495
513
|
|
|
496
514
|
Run grouped dense Context retrieval.
|
|
@@ -499,6 +517,12 @@ Run grouped dense Context retrieval.
|
|
|
499
517
|
results = project.context.grouped_search("support", embedding, group_by="tenant_id")
|
|
500
518
|
```
|
|
501
519
|
|
|
520
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
521
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
522
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
523
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
524
|
+
See the README's Query with text section for method-specific input rules.
|
|
525
|
+
|
|
502
526
|
### `project.context.index_advisor()`
|
|
503
527
|
|
|
504
528
|
Return collection filter-index recommendations.
|
|
@@ -531,6 +555,12 @@ Run coupled Context and graph joint retrieval.
|
|
|
531
555
|
results = project.context.joint("support", embedding)
|
|
532
556
|
```
|
|
533
557
|
|
|
558
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
559
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
560
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
561
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
562
|
+
See the README's Query with text section for method-specific input rules.
|
|
563
|
+
|
|
534
564
|
### `project.context.list_collections()`
|
|
535
565
|
|
|
536
566
|
List Context collections with cursor pagination.
|
|
@@ -587,6 +617,12 @@ Run the stable pgContext dense plus full-text query.
|
|
|
587
617
|
results = project.context.query("support", embedding, query="refund")
|
|
588
618
|
```
|
|
589
619
|
|
|
620
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
621
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
622
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
623
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
624
|
+
See the README's Query with text section for method-specific input rules.
|
|
625
|
+
|
|
590
626
|
### `project.context.query_cohort_stats()`
|
|
591
627
|
|
|
592
628
|
Return collection-scoped query cohort statistics.
|
|
@@ -651,6 +687,12 @@ Build a dense nearest query plan.
|
|
|
651
687
|
plan = project.context.query_nearest(embedding, limit=20)
|
|
652
688
|
```
|
|
653
689
|
|
|
690
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
691
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
692
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
693
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
694
|
+
See the README's Query with text section for method-specific input rules.
|
|
695
|
+
|
|
654
696
|
### `project.context.query_prefetch()`
|
|
655
697
|
|
|
656
698
|
Build a query plan that prefetches multiple branches.
|
|
@@ -707,6 +749,12 @@ Fuse Context and graph rankings.
|
|
|
707
749
|
results = project.context.rank_fusion("support", embedding, start=start)
|
|
708
750
|
```
|
|
709
751
|
|
|
752
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
753
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
754
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
755
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
756
|
+
See the README's Query with text section for method-specific input rules.
|
|
757
|
+
|
|
710
758
|
### `project.context.raw_vector_search()`
|
|
711
759
|
|
|
712
760
|
Search an explicit array of dense vectors.
|
|
@@ -819,6 +867,12 @@ Run dense Context retrieval.
|
|
|
819
867
|
results = project.context.search("support", embedding)
|
|
820
868
|
```
|
|
821
869
|
|
|
870
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
871
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
872
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
873
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
874
|
+
See the README's Query with text section for method-specific input rules.
|
|
875
|
+
|
|
822
876
|
### `project.context.set_default_collection()`
|
|
823
877
|
|
|
824
878
|
Make a Context collection the project default.
|
|
@@ -851,6 +905,12 @@ Run dense and lexical Context retrieval.
|
|
|
851
905
|
results = project.context.text_hybrid("support", embedding, query="refund")
|
|
852
906
|
```
|
|
853
907
|
|
|
908
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
909
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
910
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
911
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
912
|
+
See the README's Query with text section for method-specific input rules.
|
|
913
|
+
|
|
854
914
|
### `project.context.update_collection()`
|
|
855
915
|
|
|
856
916
|
Update mutable Context collection settings.
|
|
@@ -891,6 +951,12 @@ Run vector-first Context hybrid retrieval.
|
|
|
891
951
|
results = project.context.vector_first("support", embedding)
|
|
892
952
|
```
|
|
893
953
|
|
|
954
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
955
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
956
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
957
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
958
|
+
See the README's Query with text section for method-specific input rules.
|
|
959
|
+
|
|
894
960
|
### `project.context.verify_collection()`
|
|
895
961
|
|
|
896
962
|
Verify the physical state of a Context collection.
|
|
@@ -973,6 +1039,12 @@ Run graph-first hybrid retrieval.
|
|
|
973
1039
|
page = project.hybrid.graph_first(start, embedding)
|
|
974
1040
|
```
|
|
975
1041
|
|
|
1042
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
1043
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
1044
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
1045
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
1046
|
+
See the README's Query with text section for method-specific input rules.
|
|
1047
|
+
|
|
976
1048
|
### `project.hybrid.joint()`
|
|
977
1049
|
|
|
978
1050
|
Run joint vector and graph retrieval.
|
|
@@ -981,6 +1053,12 @@ Run joint vector and graph retrieval.
|
|
|
981
1053
|
page = project.hybrid.joint(embedding, start)
|
|
982
1054
|
```
|
|
983
1055
|
|
|
1056
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
1057
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
1058
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
1059
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
1060
|
+
See the README's Query with text section for method-specific input rules.
|
|
1061
|
+
|
|
984
1062
|
### `project.hybrid.vector_first()`
|
|
985
1063
|
|
|
986
1064
|
Run vector-first hybrid retrieval.
|
|
@@ -989,6 +1067,12 @@ Run vector-first hybrid retrieval.
|
|
|
989
1067
|
page = project.hybrid.vector_first(embedding)
|
|
990
1068
|
```
|
|
991
1069
|
|
|
1070
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
1071
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
1072
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
1073
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
1074
|
+
See the README's Query with text section for method-specific input rules.
|
|
1075
|
+
|
|
992
1076
|
## `project.rows`
|
|
993
1077
|
|
|
994
1078
|
| SDK method | HTTP operation | Since | Retry | Pagination | Deprecated |
|
|
@@ -1068,6 +1152,12 @@ Search a configured vector index with an embedding.
|
|
|
1068
1152
|
page = project.vector.search(embedding)
|
|
1069
1153
|
```
|
|
1070
1154
|
|
|
1155
|
+
SDK 0.5.0 supports configured query embedding generation through text input.
|
|
1156
|
+
Existing vector inputs retain their behavior. Text execution accepts optional
|
|
1157
|
+
credit usage and idempotency keys; automatic retries reuse the same attempt.
|
|
1158
|
+
Query-plan builders remain local; generation happens in execute_query().
|
|
1159
|
+
See the README's Query with text section for method-specific input rules.
|
|
1160
|
+
|
|
1071
1161
|
### `project.vector.similar_to()`
|
|
1072
1162
|
|
|
1073
1163
|
Find rows similar to an existing indexed row.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "polygres-sdk"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.0"
|
|
4
4
|
description = "Python SDK for Polygres"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -69,6 +69,7 @@ packages = ["src/polygres"]
|
|
|
69
69
|
|
|
70
70
|
[tool.hatch.build.targets.sdist]
|
|
71
71
|
include = [
|
|
72
|
+
"/CHANGELOG.md",
|
|
72
73
|
"/CONTRIBUTING.md",
|
|
73
74
|
"/LICENSE",
|
|
74
75
|
"/README.md",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Private query input validation and retry identity handling."""
|
|
2
|
+
|
|
3
|
+
from uuid import uuid4
|
|
4
|
+
|
|
5
|
+
from pydantic import ValidationError
|
|
6
|
+
|
|
7
|
+
from polygres._vendor.polygres_lib.context.models import DenseSearchRequest
|
|
8
|
+
from polygres.errors import PolygresValidationError
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def validate_query_input(embedding, text, use_credits):
|
|
12
|
+
try:
|
|
13
|
+
DenseSearchRequest(
|
|
14
|
+
collection="query", embedding=embedding, text=text, use_credits=use_credits
|
|
15
|
+
)
|
|
16
|
+
except ValidationError as exc:
|
|
17
|
+
raise PolygresValidationError(str(exc)) from exc
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def contains_query_text(payload):
|
|
21
|
+
if not isinstance(payload, dict):
|
|
22
|
+
return False
|
|
23
|
+
if payload.get("text") is not None:
|
|
24
|
+
return True
|
|
25
|
+
if "plan" in payload:
|
|
26
|
+
return contains_query_text(payload["plan"])
|
|
27
|
+
if "kind" in payload:
|
|
28
|
+
return contains_query_text(payload.get("branch")) or any(
|
|
29
|
+
contains_query_text(child) for child in payload.get("branches", [])
|
|
30
|
+
)
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def query_transport(payload, idempotency_key=None):
|
|
35
|
+
if not contains_query_text(payload):
|
|
36
|
+
# Keep vector-only wire payloads compatible with earlier Runtime versions.
|
|
37
|
+
return {k: v for k, v in payload.items() if k not in {"text", "use_credits"}}, None
|
|
38
|
+
key = idempotency_key or str(uuid4())
|
|
39
|
+
if not isinstance(key, str) or not key.strip() or len(key) > 200:
|
|
40
|
+
raise PolygresValidationError("idempotency_key must contain 1 to 200 characters")
|
|
41
|
+
return payload, {"Idempotency-Key": key}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def query_deadline(timeout):
|
|
45
|
+
import time
|
|
46
|
+
|
|
47
|
+
import httpx
|
|
48
|
+
|
|
49
|
+
seconds = timeout.read if isinstance(timeout, httpx.Timeout) else timeout
|
|
50
|
+
return None if seconds is None else time.monotonic() + float(seconds)
|