turbopuffer 1.10.1 → 1.11.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +23 -1
- data/lib/turbopuffer/client.rb +5 -1
- data/lib/turbopuffer/internal/transport/base_client.rb +13 -0
- data/lib/turbopuffer/models/namespace_write_params.rb +15 -5
- data/lib/turbopuffer/models/namespace_write_response.rb +31 -1
- data/lib/turbopuffer/request_options.rb +6 -0
- data/lib/turbopuffer/resources/namespaces.rb +7 -5
- data/lib/turbopuffer/version.rb +1 -1
- data/rbi/turbopuffer/client.rbi +3 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +19 -4
- data/rbi/turbopuffer/models/namespace_write_response.rbi +40 -1
- data/rbi/turbopuffer/request_options.rbi +4 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +9 -4
- data/sig/turbopuffer/client.rbs +1 -0
- data/sig/turbopuffer/models/namespace_write_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_write_response.rbs +29 -2
- data/sig/turbopuffer/request_options.rbs +4 -1
- data/sig/turbopuffer/resources/namespaces.rbs +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aff3f7179132d59af69be514c2bea471786e9f46d00dcda5f11b612282a5aa85
|
|
4
|
+
data.tar.gz: 79f1e6d41e927345bc44b546b6a26332748a25eaedb0b23e4e9b1f9d3054857a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 764da2c1ede0bab20b13fbfba3ec7b2114c1f92dd95f847640aaceb9dab9394e64911080177f648bf42b01c69cb6e0fd15a7414f464f2336df2bc20d84177bfd
|
|
7
|
+
data.tar.gz: 5de4d67ad3b28f4bb20506e1e21480eb277fa0cc48963b3c9afeadb8bc10e337bac501aaca6b8143608892a08891d7c5f340239deef89fc9c381ca933c81f6d6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.11.0 (2026-01-22)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.10.1...v1.11.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.10.1...v1.11.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* [TPUF-1097] tpuf: return failed IDs for conditional writes ([5b8d225](https://github.com/turbopuffer/turbopuffer-ruby/commit/5b8d2252d81caecd59c3d44458def2a107a263ed))
|
|
10
|
+
* Apigen integration ([11ae24b](https://github.com/turbopuffer/turbopuffer-ruby/commit/11ae24be6ffab51d5676abca1e5082a962037ccd))
|
|
11
|
+
* disable response compression by default ([#34](https://github.com/turbopuffer/turbopuffer-ruby/issues/34)) ([2ca1437](https://github.com/turbopuffer/turbopuffer-ruby/commit/2ca143712013e6eab35e9de8847ad7e644dbbf58))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
* configure new SDK language ([abc9dfe](https://github.com/turbopuffer/turbopuffer-ruby/commit/abc9dfe9d94f2d3d5cda214f1c9f4625a002cdb1))
|
|
17
|
+
* fix typo in descriptions ([5ce373b](https://github.com/turbopuffer/turbopuffer-ruby/commit/5ce373b8c0de6f51917446464420cb51c021c067))
|
|
18
|
+
* **internal:** update `actions/checkout` version ([09e5d5c](https://github.com/turbopuffer/turbopuffer-ruby/commit/09e5d5c35c7e9254227e3c4005849543c4f51b9e))
|
|
19
|
+
|
|
3
20
|
## 1.10.1 (2026-01-09)
|
|
4
21
|
|
|
5
22
|
Full Changelog: [v1.10.0...v1.10.1](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.10.0...v1.10.1)
|
data/README.md
CHANGED
|
@@ -4,6 +4,15 @@ The Turbopuffer Ruby library provides convenient access to the Turbopuffer REST
|
|
|
4
4
|
|
|
5
5
|
It is generated with [Stainless](https://www.stainless.com/).
|
|
6
6
|
|
|
7
|
+
## MCP Server
|
|
8
|
+
|
|
9
|
+
Use the Turbopuffer MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
10
|
+
|
|
11
|
+
[](https://cursor.com/en-US/install-mcp?name=%40turbopuffer%2Fturbopuffer-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0dXJib3B1ZmZlci90dXJib3B1ZmZlci1tY3AiXX0)
|
|
12
|
+
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40turbopuffer%2Fturbopuffer-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40turbopuffer%2Fturbopuffer-mcp%22%5D%7D)
|
|
13
|
+
|
|
14
|
+
> Note: You may need to set environment variables in your MCP client.
|
|
15
|
+
|
|
7
16
|
## Documentation
|
|
8
17
|
|
|
9
18
|
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/turbopuffer).
|
|
@@ -17,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
17
26
|
<!-- x-release-please-start-version -->
|
|
18
27
|
|
|
19
28
|
```ruby
|
|
20
|
-
gem "turbopuffer", "~> 1.
|
|
29
|
+
gem "turbopuffer", "~> 1.11.0"
|
|
21
30
|
```
|
|
22
31
|
|
|
23
32
|
<!-- x-release-please-end -->
|
|
@@ -160,6 +169,19 @@ On timeout, `Turbopuffer::Errors::APITimeoutError` is raised.
|
|
|
160
169
|
|
|
161
170
|
Note that requests that time out are retried by default.
|
|
162
171
|
|
|
172
|
+
### Compression
|
|
173
|
+
|
|
174
|
+
By default, the client does not request compressed responses. To enable compression:
|
|
175
|
+
|
|
176
|
+
```ruby
|
|
177
|
+
turbopuffer = Turbopuffer::Client.new(
|
|
178
|
+
compression: true
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
# Or, configure per-request:
|
|
182
|
+
turbopuffer.namespaces(prefix: "foo", request_options: {compression: true})
|
|
183
|
+
```
|
|
184
|
+
|
|
163
185
|
## Advanced concepts
|
|
164
186
|
|
|
165
187
|
### BaseModel
|
data/lib/turbopuffer/client.rb
CHANGED
|
@@ -82,6 +82,8 @@ module Turbopuffer
|
|
|
82
82
|
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
|
|
83
83
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["TURBOPUFFER_BASE_URL"]`
|
|
84
84
|
#
|
|
85
|
+
# @param compression [Boolean] Whether to request compressed responses. Defaults to false.
|
|
86
|
+
#
|
|
85
87
|
# @param max_retries [Integer] Max number of retries to attempt after a failed retryable request.
|
|
86
88
|
#
|
|
87
89
|
# @param timeout [Float]
|
|
@@ -94,6 +96,7 @@ module Turbopuffer
|
|
|
94
96
|
region: ENV["TURBOPUFFER_REGION"],
|
|
95
97
|
default_namespace: nil,
|
|
96
98
|
base_url: ENV["TURBOPUFFER_BASE_URL"],
|
|
99
|
+
compression: false,
|
|
97
100
|
max_retries: self.class::DEFAULT_MAX_RETRIES,
|
|
98
101
|
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
|
|
99
102
|
initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY,
|
|
@@ -123,7 +126,8 @@ module Turbopuffer
|
|
|
123
126
|
timeout: timeout,
|
|
124
127
|
max_retries: max_retries,
|
|
125
128
|
initial_retry_delay: initial_retry_delay,
|
|
126
|
-
max_retry_delay: max_retry_delay
|
|
129
|
+
max_retry_delay: max_retry_delay,
|
|
130
|
+
headers: compression ? {} : {"accept-encoding" => "identity"}
|
|
127
131
|
)
|
|
128
132
|
end
|
|
129
133
|
end
|
|
@@ -266,6 +266,8 @@ module Turbopuffer
|
|
|
266
266
|
#
|
|
267
267
|
# @option opts [Float, nil] :timeout
|
|
268
268
|
#
|
|
269
|
+
# @option opts [Boolean, nil] :compression
|
|
270
|
+
#
|
|
269
271
|
# @return [Hash{Symbol=>Object}]
|
|
270
272
|
private def build_request(req, opts)
|
|
271
273
|
method, uninterpolated_path = req.fetch_values(:method, :path)
|
|
@@ -274,9 +276,20 @@ module Turbopuffer
|
|
|
274
276
|
|
|
275
277
|
query = Turbopuffer::Internal::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h)
|
|
276
278
|
|
|
279
|
+
compression_headers =
|
|
280
|
+
case opts[:compression]
|
|
281
|
+
when true
|
|
282
|
+
{"accept-encoding" => nil}
|
|
283
|
+
when false
|
|
284
|
+
{"accept-encoding" => "identity"}
|
|
285
|
+
else
|
|
286
|
+
{}
|
|
287
|
+
end
|
|
288
|
+
|
|
277
289
|
headers = Turbopuffer::Internal::Util.normalized_headers(
|
|
278
290
|
@headers,
|
|
279
291
|
auth_headers,
|
|
292
|
+
compression_headers,
|
|
280
293
|
req[:headers].to_h,
|
|
281
294
|
opts[:extra_headers].to_h
|
|
282
295
|
)
|
|
@@ -91,6 +91,14 @@ module Turbopuffer
|
|
|
91
91
|
# @return [Array<Turbopuffer::Models::Row>, nil]
|
|
92
92
|
optional :patch_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
|
|
93
93
|
|
|
94
|
+
# @!attribute return_affected_ids
|
|
95
|
+
# If true, return the IDs of affected rows (deleted, patched, upserted) in the
|
|
96
|
+
# response. For filtered and conditional writes, only IDs for writes that
|
|
97
|
+
# succeeded will be included.
|
|
98
|
+
#
|
|
99
|
+
# @return [Boolean, nil]
|
|
100
|
+
optional :return_affected_ids, Turbopuffer::Internal::Type::Boolean
|
|
101
|
+
|
|
94
102
|
# @!attribute schema
|
|
95
103
|
# The schema of the attributes attached to the documents.
|
|
96
104
|
#
|
|
@@ -116,7 +124,7 @@ module Turbopuffer
|
|
|
116
124
|
# @return [Array<Turbopuffer::Models::Row>, nil]
|
|
117
125
|
optional :upsert_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
|
|
118
126
|
|
|
119
|
-
# @!method initialize(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
127
|
+
# @!method initialize(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
120
128
|
# Some parameter documentations has been truncated, see
|
|
121
129
|
# {Turbopuffer::Models::NamespaceWriteParams} for more details.
|
|
122
130
|
#
|
|
@@ -148,6 +156,8 @@ module Turbopuffer
|
|
|
148
156
|
#
|
|
149
157
|
# @param patch_rows [Array<Turbopuffer::Models::Row>]
|
|
150
158
|
#
|
|
159
|
+
# @param return_affected_ids [Boolean] If true, return the IDs of affected rows (deleted, patched, upserted) in the res
|
|
160
|
+
#
|
|
151
161
|
# @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] The schema of the attributes attached to the documents.
|
|
152
162
|
#
|
|
153
163
|
# @param upsert_columns [Turbopuffer::Models::Columns] A list of documents in columnar format. Each key is a column name, mapped to an
|
|
@@ -175,13 +185,13 @@ module Turbopuffer
|
|
|
175
185
|
required :source_namespace, String
|
|
176
186
|
|
|
177
187
|
# @!attribute source_api_key
|
|
178
|
-
# An API key for the organization containing the source namespace
|
|
188
|
+
# (Optional) An API key for the organization containing the source namespace
|
|
179
189
|
#
|
|
180
190
|
# @return [String, nil]
|
|
181
191
|
optional :source_api_key, String
|
|
182
192
|
|
|
183
193
|
# @!attribute source_region
|
|
184
|
-
# The region of the source namespace.
|
|
194
|
+
# (Optional) The region of the source namespace.
|
|
185
195
|
#
|
|
186
196
|
# @return [String, nil]
|
|
187
197
|
optional :source_region, String
|
|
@@ -189,9 +199,9 @@ module Turbopuffer
|
|
|
189
199
|
# @!method initialize(source_namespace:, source_api_key: nil, source_region: nil)
|
|
190
200
|
# @param source_namespace [String] The namespace to copy documents from.
|
|
191
201
|
#
|
|
192
|
-
# @param source_api_key [String] An API key for the organization containing the source namespace
|
|
202
|
+
# @param source_api_key [String] (Optional) An API key for the organization containing the source namespace
|
|
193
203
|
#
|
|
194
|
-
# @param source_region [String] The region of the source namespace.
|
|
204
|
+
# @param source_region [String] (Optional) The region of the source namespace.
|
|
195
205
|
end
|
|
196
206
|
|
|
197
207
|
# @!method self.variants
|
|
@@ -28,6 +28,20 @@ module Turbopuffer
|
|
|
28
28
|
# @return [Symbol, :OK]
|
|
29
29
|
required :status, const: :OK
|
|
30
30
|
|
|
31
|
+
# @!attribute deleted_ids
|
|
32
|
+
# The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
33
|
+
# is true and at least one document was deleted.
|
|
34
|
+
#
|
|
35
|
+
# @return [Array<String, Integer>, nil]
|
|
36
|
+
optional :deleted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
37
|
+
|
|
38
|
+
# @!attribute patched_ids
|
|
39
|
+
# The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
40
|
+
# is true and at least one document was patched.
|
|
41
|
+
#
|
|
42
|
+
# @return [Array<String, Integer>, nil]
|
|
43
|
+
optional :patched_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
44
|
+
|
|
31
45
|
# @!attribute rows_deleted
|
|
32
46
|
# The number of rows deleted by the write request.
|
|
33
47
|
#
|
|
@@ -52,7 +66,17 @@ module Turbopuffer
|
|
|
52
66
|
# @return [Integer, nil]
|
|
53
67
|
optional :rows_upserted, Integer
|
|
54
68
|
|
|
55
|
-
# @!
|
|
69
|
+
# @!attribute upserted_ids
|
|
70
|
+
# The IDs of documents that were upserted. Only included when
|
|
71
|
+
# `return_affected_ids` is true and at least one document was upserted.
|
|
72
|
+
#
|
|
73
|
+
# @return [Array<String, Integer>, nil]
|
|
74
|
+
optional :upserted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
75
|
+
|
|
76
|
+
# @!method initialize(billing:, message:, rows_affected:, deleted_ids: nil, patched_ids: nil, rows_deleted: nil, rows_patched: nil, rows_remaining: nil, rows_upserted: nil, upserted_ids: nil, status: :OK)
|
|
77
|
+
# Some parameter documentations has been truncated, see
|
|
78
|
+
# {Turbopuffer::Models::NamespaceWriteResponse} for more details.
|
|
79
|
+
#
|
|
56
80
|
# The response to a successful write request.
|
|
57
81
|
#
|
|
58
82
|
# @param billing [Turbopuffer::Models::WriteBilling] The billing information for a write request.
|
|
@@ -61,6 +85,10 @@ module Turbopuffer
|
|
|
61
85
|
#
|
|
62
86
|
# @param rows_affected [Integer] The number of rows affected by the write request.
|
|
63
87
|
#
|
|
88
|
+
# @param deleted_ids [Array<String, Integer>] The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
89
|
+
#
|
|
90
|
+
# @param patched_ids [Array<String, Integer>] The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
91
|
+
#
|
|
64
92
|
# @param rows_deleted [Integer] The number of rows deleted by the write request.
|
|
65
93
|
#
|
|
66
94
|
# @param rows_patched [Integer] The number of rows patched by the write request.
|
|
@@ -69,6 +97,8 @@ module Turbopuffer
|
|
|
69
97
|
#
|
|
70
98
|
# @param rows_upserted [Integer] The number of rows upserted by the write request.
|
|
71
99
|
#
|
|
100
|
+
# @param upserted_ids [Array<String, Integer>] The IDs of documents that were upserted. Only included when `return_affected_ids
|
|
101
|
+
#
|
|
72
102
|
# @param status [Symbol, :OK] The status of the request.
|
|
73
103
|
end
|
|
74
104
|
end
|
|
@@ -65,6 +65,12 @@ module Turbopuffer
|
|
|
65
65
|
# @return [Float, nil]
|
|
66
66
|
optional :timeout, Float
|
|
67
67
|
|
|
68
|
+
# @!attribute compression
|
|
69
|
+
# Whether to request compressed responses.
|
|
70
|
+
#
|
|
71
|
+
# @return [Boolean, nil]
|
|
72
|
+
optional :compression, Turbopuffer::Internal::Type::Boolean
|
|
73
|
+
|
|
68
74
|
# @!method initialize(values = {})
|
|
69
75
|
# Returns a new instance of RequestOptions.
|
|
70
76
|
#
|
|
@@ -131,7 +131,7 @@ module Turbopuffer
|
|
|
131
131
|
#
|
|
132
132
|
# @overload multi_query(queries:, namespace: nil, consistency: nil, vector_encoding: nil, request_options: {})
|
|
133
133
|
#
|
|
134
|
-
# @param queries [Array<Turbopuffer::Models::Query>] Body param
|
|
134
|
+
# @param queries [Array<Turbopuffer::Models::Query>] Body param
|
|
135
135
|
#
|
|
136
136
|
# @param namespace [String] Path param: The name of the namespace.
|
|
137
137
|
#
|
|
@@ -305,7 +305,7 @@ module Turbopuffer
|
|
|
305
305
|
#
|
|
306
306
|
# Create, update, or delete documents.
|
|
307
307
|
#
|
|
308
|
-
# @overload write(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
308
|
+
# @overload write(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
309
309
|
#
|
|
310
310
|
# @param namespace [String] Path param: The name of the namespace.
|
|
311
311
|
#
|
|
@@ -317,7 +317,7 @@ module Turbopuffer
|
|
|
317
317
|
#
|
|
318
318
|
# @param delete_condition [Object] Body param: A condition evaluated against the current value of each document tar
|
|
319
319
|
#
|
|
320
|
-
# @param deletes [Array<String, Integer>] Body param
|
|
320
|
+
# @param deletes [Array<String, Integer>] Body param
|
|
321
321
|
#
|
|
322
322
|
# @param disable_backpressure [Boolean] Body param: Disables write throttling (HTTP 429 responses) during high-volume in
|
|
323
323
|
#
|
|
@@ -333,7 +333,9 @@ module Turbopuffer
|
|
|
333
333
|
#
|
|
334
334
|
# @param patch_condition [Object] Body param: A condition evaluated against the current value of each document tar
|
|
335
335
|
#
|
|
336
|
-
# @param patch_rows [Array<Turbopuffer::Models::Row>] Body param
|
|
336
|
+
# @param patch_rows [Array<Turbopuffer::Models::Row>] Body param
|
|
337
|
+
#
|
|
338
|
+
# @param return_affected_ids [Boolean] Body param: If true, return the IDs of affected rows (deleted, patched, upserted
|
|
337
339
|
#
|
|
338
340
|
# @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] Body param: The schema of the attributes attached to the documents.
|
|
339
341
|
#
|
|
@@ -341,7 +343,7 @@ module Turbopuffer
|
|
|
341
343
|
#
|
|
342
344
|
# @param upsert_condition [Object] Body param: A condition evaluated against the current value of each document tar
|
|
343
345
|
#
|
|
344
|
-
# @param upsert_rows [Array<Turbopuffer::Models::Row>] Body param
|
|
346
|
+
# @param upsert_rows [Array<Turbopuffer::Models::Row>] Body param
|
|
345
347
|
#
|
|
346
348
|
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
347
349
|
#
|
data/lib/turbopuffer/version.rb
CHANGED
data/rbi/turbopuffer/client.rbi
CHANGED
|
@@ -65,6 +65,7 @@ module Turbopuffer
|
|
|
65
65
|
region: T.nilable(String),
|
|
66
66
|
default_namespace: T.nilable(String),
|
|
67
67
|
base_url: T.nilable(String),
|
|
68
|
+
compression: T::Boolean,
|
|
68
69
|
max_retries: Integer,
|
|
69
70
|
timeout: Float,
|
|
70
71
|
initial_retry_delay: Float,
|
|
@@ -80,6 +81,8 @@ module Turbopuffer
|
|
|
80
81
|
# Override the default base URL for the API, e.g.,
|
|
81
82
|
# `"https://api.example.com/v2/"`. Defaults to `ENV["TURBOPUFFER_BASE_URL"]`
|
|
82
83
|
base_url: ENV["TURBOPUFFER_BASE_URL"],
|
|
84
|
+
# Whether to request compressed responses. Defaults to false.
|
|
85
|
+
compression: false,
|
|
83
86
|
# Max number of retries to attempt after a failed retryable request.
|
|
84
87
|
max_retries: Turbopuffer::Client::DEFAULT_MAX_RETRIES,
|
|
85
88
|
timeout: Turbopuffer::Client::DEFAULT_TIMEOUT_IN_SECONDS,
|
|
@@ -142,6 +142,15 @@ module Turbopuffer
|
|
|
142
142
|
sig { params(patch_rows: T::Array[Turbopuffer::Row::OrHash]).void }
|
|
143
143
|
attr_writer :patch_rows
|
|
144
144
|
|
|
145
|
+
# If true, return the IDs of affected rows (deleted, patched, upserted) in the
|
|
146
|
+
# response. For filtered and conditional writes, only IDs for writes that
|
|
147
|
+
# succeeded will be included.
|
|
148
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
149
|
+
attr_reader :return_affected_ids
|
|
150
|
+
|
|
151
|
+
sig { params(return_affected_ids: T::Boolean).void }
|
|
152
|
+
attr_writer :return_affected_ids
|
|
153
|
+
|
|
145
154
|
# The schema of the attributes attached to the documents.
|
|
146
155
|
sig do
|
|
147
156
|
returns(
|
|
@@ -206,6 +215,7 @@ module Turbopuffer
|
|
|
206
215
|
patch_columns: Turbopuffer::Columns::OrHash,
|
|
207
216
|
patch_condition: T.anything,
|
|
208
217
|
patch_rows: T::Array[Turbopuffer::Row::OrHash],
|
|
218
|
+
return_affected_ids: T::Boolean,
|
|
209
219
|
schema:
|
|
210
220
|
T::Hash[
|
|
211
221
|
Symbol,
|
|
@@ -246,6 +256,10 @@ module Turbopuffer
|
|
|
246
256
|
# patch write. Only documents that pass the condition are patched.
|
|
247
257
|
patch_condition: nil,
|
|
248
258
|
patch_rows: nil,
|
|
259
|
+
# If true, return the IDs of affected rows (deleted, patched, upserted) in the
|
|
260
|
+
# response. For filtered and conditional writes, only IDs for writes that
|
|
261
|
+
# succeeded will be included.
|
|
262
|
+
return_affected_ids: nil,
|
|
249
263
|
# The schema of the attributes attached to the documents.
|
|
250
264
|
schema: nil,
|
|
251
265
|
# A list of documents in columnar format. Each key is a column name, mapped to an
|
|
@@ -280,6 +294,7 @@ module Turbopuffer
|
|
|
280
294
|
patch_columns: Turbopuffer::Columns,
|
|
281
295
|
patch_condition: T.anything,
|
|
282
296
|
patch_rows: T::Array[Turbopuffer::Row],
|
|
297
|
+
return_affected_ids: T::Boolean,
|
|
283
298
|
schema:
|
|
284
299
|
T::Hash[
|
|
285
300
|
Symbol,
|
|
@@ -320,14 +335,14 @@ module Turbopuffer
|
|
|
320
335
|
sig { returns(String) }
|
|
321
336
|
attr_accessor :source_namespace
|
|
322
337
|
|
|
323
|
-
# An API key for the organization containing the source namespace
|
|
338
|
+
# (Optional) An API key for the organization containing the source namespace
|
|
324
339
|
sig { returns(T.nilable(String)) }
|
|
325
340
|
attr_reader :source_api_key
|
|
326
341
|
|
|
327
342
|
sig { params(source_api_key: String).void }
|
|
328
343
|
attr_writer :source_api_key
|
|
329
344
|
|
|
330
|
-
# The region of the source namespace.
|
|
345
|
+
# (Optional) The region of the source namespace.
|
|
331
346
|
sig { returns(T.nilable(String)) }
|
|
332
347
|
attr_reader :source_region
|
|
333
348
|
|
|
@@ -344,9 +359,9 @@ module Turbopuffer
|
|
|
344
359
|
def self.new(
|
|
345
360
|
# The namespace to copy documents from.
|
|
346
361
|
source_namespace:,
|
|
347
|
-
# An API key for the organization containing the source namespace
|
|
362
|
+
# (Optional) An API key for the organization containing the source namespace
|
|
348
363
|
source_api_key: nil,
|
|
349
|
-
# The region of the source namespace.
|
|
364
|
+
# (Optional) The region of the source namespace.
|
|
350
365
|
source_region: nil
|
|
351
366
|
)
|
|
352
367
|
end
|
|
@@ -30,6 +30,22 @@ module Turbopuffer
|
|
|
30
30
|
sig { returns(Symbol) }
|
|
31
31
|
attr_accessor :status
|
|
32
32
|
|
|
33
|
+
# The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
34
|
+
# is true and at least one document was deleted.
|
|
35
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::ID::Variants])) }
|
|
36
|
+
attr_reader :deleted_ids
|
|
37
|
+
|
|
38
|
+
sig { params(deleted_ids: T::Array[Turbopuffer::ID::Variants]).void }
|
|
39
|
+
attr_writer :deleted_ids
|
|
40
|
+
|
|
41
|
+
# The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
42
|
+
# is true and at least one document was patched.
|
|
43
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::ID::Variants])) }
|
|
44
|
+
attr_reader :patched_ids
|
|
45
|
+
|
|
46
|
+
sig { params(patched_ids: T::Array[Turbopuffer::ID::Variants]).void }
|
|
47
|
+
attr_writer :patched_ids
|
|
48
|
+
|
|
33
49
|
# The number of rows deleted by the write request.
|
|
34
50
|
sig { returns(T.nilable(Integer)) }
|
|
35
51
|
attr_reader :rows_deleted
|
|
@@ -58,16 +74,27 @@ module Turbopuffer
|
|
|
58
74
|
sig { params(rows_upserted: Integer).void }
|
|
59
75
|
attr_writer :rows_upserted
|
|
60
76
|
|
|
77
|
+
# The IDs of documents that were upserted. Only included when
|
|
78
|
+
# `return_affected_ids` is true and at least one document was upserted.
|
|
79
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::ID::Variants])) }
|
|
80
|
+
attr_reader :upserted_ids
|
|
81
|
+
|
|
82
|
+
sig { params(upserted_ids: T::Array[Turbopuffer::ID::Variants]).void }
|
|
83
|
+
attr_writer :upserted_ids
|
|
84
|
+
|
|
61
85
|
# The response to a successful write request.
|
|
62
86
|
sig do
|
|
63
87
|
params(
|
|
64
88
|
billing: Turbopuffer::WriteBilling::OrHash,
|
|
65
89
|
message: String,
|
|
66
90
|
rows_affected: Integer,
|
|
91
|
+
deleted_ids: T::Array[Turbopuffer::ID::Variants],
|
|
92
|
+
patched_ids: T::Array[Turbopuffer::ID::Variants],
|
|
67
93
|
rows_deleted: Integer,
|
|
68
94
|
rows_patched: Integer,
|
|
69
95
|
rows_remaining: T::Boolean,
|
|
70
96
|
rows_upserted: Integer,
|
|
97
|
+
upserted_ids: T::Array[Turbopuffer::ID::Variants],
|
|
71
98
|
status: Symbol
|
|
72
99
|
).returns(T.attached_class)
|
|
73
100
|
end
|
|
@@ -78,6 +105,12 @@ module Turbopuffer
|
|
|
78
105
|
message:,
|
|
79
106
|
# The number of rows affected by the write request.
|
|
80
107
|
rows_affected:,
|
|
108
|
+
# The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
109
|
+
# is true and at least one document was deleted.
|
|
110
|
+
deleted_ids: nil,
|
|
111
|
+
# The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
112
|
+
# is true and at least one document was patched.
|
|
113
|
+
patched_ids: nil,
|
|
81
114
|
# The number of rows deleted by the write request.
|
|
82
115
|
rows_deleted: nil,
|
|
83
116
|
# The number of rows patched by the write request.
|
|
@@ -86,6 +119,9 @@ module Turbopuffer
|
|
|
86
119
|
rows_remaining: nil,
|
|
87
120
|
# The number of rows upserted by the write request.
|
|
88
121
|
rows_upserted: nil,
|
|
122
|
+
# The IDs of documents that were upserted. Only included when
|
|
123
|
+
# `return_affected_ids` is true and at least one document was upserted.
|
|
124
|
+
upserted_ids: nil,
|
|
89
125
|
# The status of the request.
|
|
90
126
|
status: :OK
|
|
91
127
|
)
|
|
@@ -98,10 +134,13 @@ module Turbopuffer
|
|
|
98
134
|
message: String,
|
|
99
135
|
rows_affected: Integer,
|
|
100
136
|
status: Symbol,
|
|
137
|
+
deleted_ids: T::Array[Turbopuffer::ID::Variants],
|
|
138
|
+
patched_ids: T::Array[Turbopuffer::ID::Variants],
|
|
101
139
|
rows_deleted: Integer,
|
|
102
140
|
rows_patched: Integer,
|
|
103
141
|
rows_remaining: T::Boolean,
|
|
104
|
-
rows_upserted: Integer
|
|
142
|
+
rows_upserted: Integer,
|
|
143
|
+
upserted_ids: T::Array[Turbopuffer::ID::Variants]
|
|
105
144
|
}
|
|
106
145
|
)
|
|
107
146
|
end
|
|
@@ -49,6 +49,10 @@ module Turbopuffer
|
|
|
49
49
|
sig { returns(T.nilable(Float)) }
|
|
50
50
|
attr_accessor :timeout
|
|
51
51
|
|
|
52
|
+
# Whether to request compressed responses.
|
|
53
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
54
|
+
attr_accessor :compression
|
|
55
|
+
|
|
52
56
|
# Returns a new instance of RequestOptions.
|
|
53
57
|
sig do
|
|
54
58
|
params(values: Turbopuffer::Internal::AnyHash).returns(T.attached_class)
|
|
@@ -106,7 +106,7 @@ module Turbopuffer
|
|
|
106
106
|
).returns(Turbopuffer::Models::NamespaceMultiQueryResponse)
|
|
107
107
|
end
|
|
108
108
|
def multi_query(
|
|
109
|
-
# Body param
|
|
109
|
+
# Body param
|
|
110
110
|
queries:,
|
|
111
111
|
# Path param: The name of the namespace.
|
|
112
112
|
namespace: nil,
|
|
@@ -254,6 +254,7 @@ module Turbopuffer
|
|
|
254
254
|
patch_columns: Turbopuffer::Columns::OrHash,
|
|
255
255
|
patch_condition: T.anything,
|
|
256
256
|
patch_rows: T::Array[Turbopuffer::Row::OrHash],
|
|
257
|
+
return_affected_ids: T::Boolean,
|
|
257
258
|
schema:
|
|
258
259
|
T::Hash[
|
|
259
260
|
Symbol,
|
|
@@ -277,7 +278,7 @@ module Turbopuffer
|
|
|
277
278
|
# Body param: A condition evaluated against the current value of each document
|
|
278
279
|
# targeted by a delete write. Only documents that pass the condition are deleted.
|
|
279
280
|
delete_condition: nil,
|
|
280
|
-
# Body param
|
|
281
|
+
# Body param
|
|
281
282
|
deletes: nil,
|
|
282
283
|
# Body param: Disables write throttling (HTTP 429 responses) during high-volume
|
|
283
284
|
# ingestion.
|
|
@@ -296,8 +297,12 @@ module Turbopuffer
|
|
|
296
297
|
# Body param: A condition evaluated against the current value of each document
|
|
297
298
|
# targeted by a patch write. Only documents that pass the condition are patched.
|
|
298
299
|
patch_condition: nil,
|
|
299
|
-
# Body param
|
|
300
|
+
# Body param
|
|
300
301
|
patch_rows: nil,
|
|
302
|
+
# Body param: If true, return the IDs of affected rows (deleted, patched,
|
|
303
|
+
# upserted) in the response. For filtered and conditional writes, only IDs for
|
|
304
|
+
# writes that succeeded will be included.
|
|
305
|
+
return_affected_ids: nil,
|
|
301
306
|
# Body param: The schema of the attributes attached to the documents.
|
|
302
307
|
schema: nil,
|
|
303
308
|
# Body param: A list of documents in columnar format. Each key is a column name,
|
|
@@ -307,7 +312,7 @@ module Turbopuffer
|
|
|
307
312
|
# targeted by an upsert write. Only documents that pass the condition are
|
|
308
313
|
# upserted.
|
|
309
314
|
upsert_condition: nil,
|
|
310
|
-
# Body param
|
|
315
|
+
# Body param
|
|
311
316
|
upsert_rows: nil,
|
|
312
317
|
request_options: {}
|
|
313
318
|
)
|
data/sig/turbopuffer/client.rbs
CHANGED
|
@@ -16,6 +16,7 @@ module Turbopuffer
|
|
|
16
16
|
patch_columns: Turbopuffer::Columns,
|
|
17
17
|
patch_condition: top,
|
|
18
18
|
patch_rows: ::Array[Turbopuffer::Row],
|
|
19
|
+
return_affected_ids: bool,
|
|
19
20
|
schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
|
20
21
|
upsert_columns: Turbopuffer::Columns,
|
|
21
22
|
upsert_condition: top,
|
|
@@ -93,6 +94,10 @@ module Turbopuffer
|
|
|
93
94
|
|
|
94
95
|
def patch_rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
|
|
95
96
|
|
|
97
|
+
attr_reader return_affected_ids: bool?
|
|
98
|
+
|
|
99
|
+
def return_affected_ids=: (bool) -> bool
|
|
100
|
+
|
|
96
101
|
attr_reader schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema]?
|
|
97
102
|
|
|
98
103
|
def schema=: (
|
|
@@ -126,6 +131,7 @@ module Turbopuffer
|
|
|
126
131
|
?patch_columns: Turbopuffer::Columns,
|
|
127
132
|
?patch_condition: top,
|
|
128
133
|
?patch_rows: ::Array[Turbopuffer::Row],
|
|
134
|
+
?return_affected_ids: bool,
|
|
129
135
|
?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
|
130
136
|
?upsert_columns: Turbopuffer::Columns,
|
|
131
137
|
?upsert_condition: top,
|
|
@@ -148,6 +154,7 @@ module Turbopuffer
|
|
|
148
154
|
patch_columns: Turbopuffer::Columns,
|
|
149
155
|
patch_condition: top,
|
|
150
156
|
patch_rows: ::Array[Turbopuffer::Row],
|
|
157
|
+
return_affected_ids: bool,
|
|
151
158
|
schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
|
152
159
|
upsert_columns: Turbopuffer::Columns,
|
|
153
160
|
upsert_condition: top,
|
|
@@ -6,10 +6,13 @@ module Turbopuffer
|
|
|
6
6
|
message: String,
|
|
7
7
|
rows_affected: Integer,
|
|
8
8
|
status: :OK,
|
|
9
|
+
deleted_ids: ::Array[Turbopuffer::Models::id],
|
|
10
|
+
patched_ids: ::Array[Turbopuffer::Models::id],
|
|
9
11
|
rows_deleted: Integer,
|
|
10
12
|
rows_patched: Integer,
|
|
11
13
|
rows_remaining: bool,
|
|
12
|
-
rows_upserted: Integer
|
|
14
|
+
rows_upserted: Integer,
|
|
15
|
+
upserted_ids: ::Array[Turbopuffer::Models::id]
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
class NamespaceWriteResponse < Turbopuffer::Internal::Type::BaseModel
|
|
@@ -21,6 +24,18 @@ module Turbopuffer
|
|
|
21
24
|
|
|
22
25
|
attr_accessor status: :OK
|
|
23
26
|
|
|
27
|
+
attr_reader deleted_ids: ::Array[Turbopuffer::Models::id]?
|
|
28
|
+
|
|
29
|
+
def deleted_ids=: (
|
|
30
|
+
::Array[Turbopuffer::Models::id]
|
|
31
|
+
) -> ::Array[Turbopuffer::Models::id]
|
|
32
|
+
|
|
33
|
+
attr_reader patched_ids: ::Array[Turbopuffer::Models::id]?
|
|
34
|
+
|
|
35
|
+
def patched_ids=: (
|
|
36
|
+
::Array[Turbopuffer::Models::id]
|
|
37
|
+
) -> ::Array[Turbopuffer::Models::id]
|
|
38
|
+
|
|
24
39
|
attr_reader rows_deleted: Integer?
|
|
25
40
|
|
|
26
41
|
def rows_deleted=: (Integer) -> Integer
|
|
@@ -37,14 +52,23 @@ module Turbopuffer
|
|
|
37
52
|
|
|
38
53
|
def rows_upserted=: (Integer) -> Integer
|
|
39
54
|
|
|
55
|
+
attr_reader upserted_ids: ::Array[Turbopuffer::Models::id]?
|
|
56
|
+
|
|
57
|
+
def upserted_ids=: (
|
|
58
|
+
::Array[Turbopuffer::Models::id]
|
|
59
|
+
) -> ::Array[Turbopuffer::Models::id]
|
|
60
|
+
|
|
40
61
|
def initialize: (
|
|
41
62
|
billing: Turbopuffer::WriteBilling,
|
|
42
63
|
message: String,
|
|
43
64
|
rows_affected: Integer,
|
|
65
|
+
?deleted_ids: ::Array[Turbopuffer::Models::id],
|
|
66
|
+
?patched_ids: ::Array[Turbopuffer::Models::id],
|
|
44
67
|
?rows_deleted: Integer,
|
|
45
68
|
?rows_patched: Integer,
|
|
46
69
|
?rows_remaining: bool,
|
|
47
70
|
?rows_upserted: Integer,
|
|
71
|
+
?upserted_ids: ::Array[Turbopuffer::Models::id],
|
|
48
72
|
?status: :OK
|
|
49
73
|
) -> void
|
|
50
74
|
|
|
@@ -53,10 +77,13 @@ module Turbopuffer
|
|
|
53
77
|
message: String,
|
|
54
78
|
rows_affected: Integer,
|
|
55
79
|
status: :OK,
|
|
80
|
+
deleted_ids: ::Array[Turbopuffer::Models::id],
|
|
81
|
+
patched_ids: ::Array[Turbopuffer::Models::id],
|
|
56
82
|
rows_deleted: Integer,
|
|
57
83
|
rows_patched: Integer,
|
|
58
84
|
rows_remaining: bool,
|
|
59
|
-
rows_upserted: Integer
|
|
85
|
+
rows_upserted: Integer,
|
|
86
|
+
upserted_ids: ::Array[Turbopuffer::Models::id]
|
|
60
87
|
}
|
|
61
88
|
end
|
|
62
89
|
end
|
|
@@ -11,7 +11,8 @@ module Turbopuffer
|
|
|
11
11
|
extra_headers: ::Hash[String, String?]?,
|
|
12
12
|
extra_body: top?,
|
|
13
13
|
max_retries: Integer?,
|
|
14
|
-
timeout: Float
|
|
14
|
+
timeout: Float?,
|
|
15
|
+
compression: bool?
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
class RequestOptions < Turbopuffer::Internal::Type::BaseModel
|
|
@@ -29,6 +30,8 @@ module Turbopuffer
|
|
|
29
30
|
|
|
30
31
|
attr_accessor timeout: Float?
|
|
31
32
|
|
|
33
|
+
attr_accessor compression: bool?
|
|
34
|
+
|
|
32
35
|
def initialize: (
|
|
33
36
|
?Turbopuffer::request_options | ::Hash[Symbol, top] values
|
|
34
37
|
) -> void
|
|
@@ -90,6 +90,7 @@ module Turbopuffer
|
|
|
90
90
|
?patch_columns: Turbopuffer::Columns,
|
|
91
91
|
?patch_condition: top,
|
|
92
92
|
?patch_rows: ::Array[Turbopuffer::Row],
|
|
93
|
+
?return_affected_ids: bool,
|
|
93
94
|
?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
|
94
95
|
?upsert_columns: Turbopuffer::Columns,
|
|
95
96
|
?upsert_condition: top,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: turbopuffer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.11.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Turbopuffer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|