turbopuffer 2.4.0 → 2.5.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 +19 -0
- data/README.md +1 -10
- data/lib/turbopuffer/client.rb +2 -2
- data/lib/turbopuffer/internal/type/union.rb +17 -7
- data/lib/turbopuffer/models/copy_from_namespace_operation.rb +84 -0
- data/lib/turbopuffer/models/copy_from_namespace_operation_result.rb +37 -0
- data/lib/turbopuffer/models/namespace_explain_query_params.rb +10 -1
- data/lib/turbopuffer/models/namespace_metadata.rb +21 -2
- data/lib/turbopuffer/models/namespace_metadata_patch.rb +10 -1
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +45 -2
- data/lib/turbopuffer/models/namespace_poll_copy_from_params.rb +26 -0
- data/lib/turbopuffer/models/namespace_query_params.rb +10 -1
- data/lib/turbopuffer/models/namespace_start_copy_from_params.rb +53 -0
- data/lib/turbopuffer/models/namespace_start_copy_from_response.rb +17 -0
- data/lib/turbopuffer/models/operation_error.rb +46 -0
- data/lib/turbopuffer/models/rerank_limit.rb +18 -0
- data/lib/turbopuffer/models/write_result.rb +112 -0
- data/lib/turbopuffer/models.rb +14 -0
- data/lib/turbopuffer/resources/namespaces.rb +80 -4
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +8 -0
- data/rbi/turbopuffer/client.rbi +2 -2
- data/rbi/turbopuffer/models/copy_from_namespace_operation.rbi +133 -0
- data/rbi/turbopuffer/models/copy_from_namespace_operation_result.rbi +85 -0
- data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +13 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +30 -1
- data/rbi/turbopuffer/models/namespace_metadata_patch.rbi +18 -3
- data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +54 -0
- data/rbi/turbopuffer/models/namespace_poll_copy_from_params.rbi +49 -0
- data/rbi/turbopuffer/models/namespace_query_params.rbi +13 -0
- data/rbi/turbopuffer/models/namespace_start_copy_from_params.rbi +113 -0
- data/rbi/turbopuffer/models/namespace_start_copy_from_response.rbi +30 -0
- data/rbi/turbopuffer/models/operation_error.rbi +77 -0
- data/rbi/turbopuffer/models/rerank_limit.rbi +28 -0
- data/rbi/turbopuffer/models/write_result.rbi +159 -0
- data/rbi/turbopuffer/models.rbi +16 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +71 -0
- data/sig/turbopuffer/models/copy_from_namespace_operation.rbs +65 -0
- data/sig/turbopuffer/models/copy_from_namespace_operation_result.rbs +33 -0
- data/sig/turbopuffer/models/namespace_explain_query_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +17 -1
- data/sig/turbopuffer/models/namespace_metadata_patch.rbs +12 -3
- data/sig/turbopuffer/models/namespace_multi_query_params.rbs +31 -0
- data/sig/turbopuffer/models/namespace_poll_copy_from_params.rbs +30 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_start_copy_from_params.rbs +56 -0
- data/sig/turbopuffer/models/namespace_start_copy_from_response.rbs +13 -0
- data/sig/turbopuffer/models/operation_error.rbs +34 -0
- data/sig/turbopuffer/models/rerank_limit.rbs +13 -0
- data/sig/turbopuffer/models/write_result.rbs +99 -0
- data/sig/turbopuffer/models.rbs +14 -0
- data/sig/turbopuffer/resources/namespaces.rbs +20 -0
- metadata +26 -2
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
class WriteResult < Turbopuffer::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute billing
|
|
7
|
+
# The billing information for a write request.
|
|
8
|
+
#
|
|
9
|
+
# @return [Turbopuffer::Models::WriteBilling]
|
|
10
|
+
required :billing, -> { Turbopuffer::WriteBilling }
|
|
11
|
+
|
|
12
|
+
# @!attribute message
|
|
13
|
+
# A message describing the result of the write request.
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :message, String
|
|
17
|
+
|
|
18
|
+
# @!attribute rows_affected
|
|
19
|
+
# The number of rows affected by the write request.
|
|
20
|
+
#
|
|
21
|
+
# @return [Integer]
|
|
22
|
+
required :rows_affected, Integer
|
|
23
|
+
|
|
24
|
+
# @!attribute status
|
|
25
|
+
# The status of the request.
|
|
26
|
+
#
|
|
27
|
+
# @return [Symbol, :OK]
|
|
28
|
+
required :status, const: :OK
|
|
29
|
+
|
|
30
|
+
# @!attribute deleted_ids
|
|
31
|
+
# The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
32
|
+
# is true and at least one document was deleted.
|
|
33
|
+
#
|
|
34
|
+
# @return [Array<String, Integer>, nil]
|
|
35
|
+
optional :deleted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
36
|
+
|
|
37
|
+
# @!attribute patched_ids
|
|
38
|
+
# The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
39
|
+
# is true and at least one document was patched.
|
|
40
|
+
#
|
|
41
|
+
# @return [Array<String, Integer>, nil]
|
|
42
|
+
optional :patched_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
43
|
+
|
|
44
|
+
# @!attribute performance
|
|
45
|
+
# The performance information for a write request.
|
|
46
|
+
#
|
|
47
|
+
# @return [Turbopuffer::Models::WritePerformance, nil]
|
|
48
|
+
optional :performance, -> { Turbopuffer::WritePerformance }
|
|
49
|
+
|
|
50
|
+
# @!attribute rows_deleted
|
|
51
|
+
# The number of rows deleted by the write request.
|
|
52
|
+
#
|
|
53
|
+
# @return [Integer, nil]
|
|
54
|
+
optional :rows_deleted, Integer
|
|
55
|
+
|
|
56
|
+
# @!attribute rows_patched
|
|
57
|
+
# The number of rows patched by the write request.
|
|
58
|
+
#
|
|
59
|
+
# @return [Integer, nil]
|
|
60
|
+
optional :rows_patched, Integer
|
|
61
|
+
|
|
62
|
+
# @!attribute rows_remaining
|
|
63
|
+
# Whether more documents match the filter for partial operations.
|
|
64
|
+
#
|
|
65
|
+
# @return [Boolean, nil]
|
|
66
|
+
optional :rows_remaining, Turbopuffer::Internal::Type::Boolean
|
|
67
|
+
|
|
68
|
+
# @!attribute rows_upserted
|
|
69
|
+
# The number of rows upserted by the write request.
|
|
70
|
+
#
|
|
71
|
+
# @return [Integer, nil]
|
|
72
|
+
optional :rows_upserted, Integer
|
|
73
|
+
|
|
74
|
+
# @!attribute upserted_ids
|
|
75
|
+
# The IDs of documents that were upserted. Only included when
|
|
76
|
+
# `return_affected_ids` is true and at least one document was upserted.
|
|
77
|
+
#
|
|
78
|
+
# @return [Array<String, Integer>, nil]
|
|
79
|
+
optional :upserted_ids, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
|
80
|
+
|
|
81
|
+
# @!method initialize(billing:, message:, rows_affected:, deleted_ids: nil, patched_ids: nil, performance: nil, rows_deleted: nil, rows_patched: nil, rows_remaining: nil, rows_upserted: nil, upserted_ids: nil, status: :OK)
|
|
82
|
+
# Some parameter documentations has been truncated, see
|
|
83
|
+
# {Turbopuffer::Models::WriteResult} for more details.
|
|
84
|
+
#
|
|
85
|
+
# The response to a successful write request.
|
|
86
|
+
#
|
|
87
|
+
# @param billing [Turbopuffer::Models::WriteBilling] The billing information for a write request.
|
|
88
|
+
#
|
|
89
|
+
# @param message [String] A message describing the result of the write request.
|
|
90
|
+
#
|
|
91
|
+
# @param rows_affected [Integer] The number of rows affected by the write request.
|
|
92
|
+
#
|
|
93
|
+
# @param deleted_ids [Array<String, Integer>] The IDs of documents that were deleted. Only included when `return_affected_ids`
|
|
94
|
+
#
|
|
95
|
+
# @param patched_ids [Array<String, Integer>] The IDs of documents that were patched. Only included when `return_affected_ids`
|
|
96
|
+
#
|
|
97
|
+
# @param performance [Turbopuffer::Models::WritePerformance] The performance information for a write request.
|
|
98
|
+
#
|
|
99
|
+
# @param rows_deleted [Integer] The number of rows deleted by the write request.
|
|
100
|
+
#
|
|
101
|
+
# @param rows_patched [Integer] The number of rows patched by the write request.
|
|
102
|
+
#
|
|
103
|
+
# @param rows_remaining [Boolean] Whether more documents match the filter for partial operations.
|
|
104
|
+
#
|
|
105
|
+
# @param rows_upserted [Integer] The number of rows upserted by the write request.
|
|
106
|
+
#
|
|
107
|
+
# @param upserted_ids [Array<String, Integer>] The IDs of documents that were upserted. Only included when `return_affected_ids
|
|
108
|
+
#
|
|
109
|
+
# @param status [Symbol, :OK] The status of the request.
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
data/lib/turbopuffer/models.rb
CHANGED
|
@@ -64,6 +64,10 @@ module Turbopuffer
|
|
|
64
64
|
|
|
65
65
|
ContainsAnyTokenFilterParams = Turbopuffer::Models::ContainsAnyTokenFilterParams
|
|
66
66
|
|
|
67
|
+
CopyFromNamespaceOperation = Turbopuffer::Models::CopyFromNamespaceOperation
|
|
68
|
+
|
|
69
|
+
CopyFromNamespaceOperationResult = Turbopuffer::Models::CopyFromNamespaceOperationResult
|
|
70
|
+
|
|
67
71
|
CopyFromNamespaceParams = Turbopuffer::Models::CopyFromNamespaceParams
|
|
68
72
|
|
|
69
73
|
DecayParams = Turbopuffer::Models::DecayParams
|
|
@@ -114,12 +118,16 @@ module Turbopuffer
|
|
|
114
118
|
|
|
115
119
|
NamespaceMultiQueryParams = Turbopuffer::Models::NamespaceMultiQueryParams
|
|
116
120
|
|
|
121
|
+
NamespacePollCopyFromParams = Turbopuffer::Models::NamespacePollCopyFromParams
|
|
122
|
+
|
|
117
123
|
NamespaceQueryParams = Turbopuffer::Models::NamespaceQueryParams
|
|
118
124
|
|
|
119
125
|
NamespaceRecallParams = Turbopuffer::Models::NamespaceRecallParams
|
|
120
126
|
|
|
121
127
|
NamespaceSchemaParams = Turbopuffer::Models::NamespaceSchemaParams
|
|
122
128
|
|
|
129
|
+
NamespaceStartCopyFromParams = Turbopuffer::Models::NamespaceStartCopyFromParams
|
|
130
|
+
|
|
123
131
|
NamespaceSummary = Turbopuffer::Models::NamespaceSummary
|
|
124
132
|
|
|
125
133
|
NamespaceUpdateMetadataParams = Turbopuffer::Models::NamespaceUpdateMetadataParams
|
|
@@ -128,12 +136,16 @@ module Turbopuffer
|
|
|
128
136
|
|
|
129
137
|
NamespaceWriteParams = Turbopuffer::Models::NamespaceWriteParams
|
|
130
138
|
|
|
139
|
+
OperationError = Turbopuffer::Models::OperationError
|
|
140
|
+
|
|
131
141
|
PinningConfig = Turbopuffer::Models::PinningConfig
|
|
132
142
|
|
|
133
143
|
QueryBilling = Turbopuffer::Models::QueryBilling
|
|
134
144
|
|
|
135
145
|
QueryPerformance = Turbopuffer::Models::QueryPerformance
|
|
136
146
|
|
|
147
|
+
RerankLimit = Turbopuffer::Models::RerankLimit
|
|
148
|
+
|
|
137
149
|
Row = Turbopuffer::Models::Row
|
|
138
150
|
|
|
139
151
|
RrfParams = Turbopuffer::Models::RrfParams
|
|
@@ -153,4 +165,6 @@ module Turbopuffer
|
|
|
153
165
|
WriteBilling = Turbopuffer::Models::WriteBilling
|
|
154
166
|
|
|
155
167
|
WritePerformance = Turbopuffer::Models::WritePerformance
|
|
168
|
+
|
|
169
|
+
WriteResult = Turbopuffer::Models::WriteResult
|
|
156
170
|
end
|
|
@@ -98,7 +98,7 @@ module Turbopuffer
|
|
|
98
98
|
#
|
|
99
99
|
# Explain a query plan.
|
|
100
100
|
#
|
|
101
|
-
# @overload explain_query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
101
|
+
# @overload explain_query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, offset: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
102
102
|
#
|
|
103
103
|
# @param namespace [String] Path param: The name of the namespace.
|
|
104
104
|
#
|
|
@@ -120,6 +120,8 @@ module Turbopuffer
|
|
|
120
120
|
#
|
|
121
121
|
# @param limit [Integer, Turbopuffer::Models::Limit] Body param: Limits the documents returned by a query.
|
|
122
122
|
#
|
|
123
|
+
# @param offset [Integer] Body param: Number of documents to skip before returning results. Supported only
|
|
124
|
+
#
|
|
123
125
|
# @param rank_by [Object] Body param: How to rank the documents in the namespace.
|
|
124
126
|
#
|
|
125
127
|
# @param top_k [Integer] Body param: The number of results to return.
|
|
@@ -201,7 +203,7 @@ module Turbopuffer
|
|
|
201
203
|
#
|
|
202
204
|
# Issue multiple concurrent queries filter or search documents.
|
|
203
205
|
#
|
|
204
|
-
# @overload multi_query(queries:, namespace: nil, consistency: nil, rerank_by: nil, vector_encoding: nil, request_options: {})
|
|
206
|
+
# @overload multi_query(queries:, namespace: nil, consistency: nil, limit: nil, offset: nil, rerank_by: nil, vector_encoding: nil, request_options: {})
|
|
205
207
|
#
|
|
206
208
|
# @param queries [Array<Turbopuffer::Models::NamespaceMultiQueryParams::Query>] Body param
|
|
207
209
|
#
|
|
@@ -209,6 +211,10 @@ module Turbopuffer
|
|
|
209
211
|
#
|
|
210
212
|
# @param consistency [Turbopuffer::Models::NamespaceMultiQueryParams::Consistency] Body param: The consistency level for a query.
|
|
211
213
|
#
|
|
214
|
+
# @param limit [Integer, Turbopuffer::Models::RerankLimit] Body param: Limits the total number of reranked documents returned.
|
|
215
|
+
#
|
|
216
|
+
# @param offset [Integer] Body param: Number of reranked documents to skip before returning results. Requi
|
|
217
|
+
#
|
|
212
218
|
# @param rerank_by [Object] Body param: How to combine the rows returned by each sub-query into a single ran
|
|
213
219
|
#
|
|
214
220
|
# @param vector_encoding [Symbol, Turbopuffer::Models::VectorEncoding] Body param: The encoding to use for vectors in the response.
|
|
@@ -233,12 +239,39 @@ module Turbopuffer
|
|
|
233
239
|
)
|
|
234
240
|
end
|
|
235
241
|
|
|
242
|
+
# Retrieve the current status of a copy operation.
|
|
243
|
+
#
|
|
244
|
+
# @overload poll_copy_from(token, namespace: nil, request_options: {})
|
|
245
|
+
#
|
|
246
|
+
# @param token [String] The operation token obtained when starting the copy.
|
|
247
|
+
#
|
|
248
|
+
# @param namespace [String] The name of the namespace.
|
|
249
|
+
#
|
|
250
|
+
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
251
|
+
#
|
|
252
|
+
# @return [Turbopuffer::Models::CopyFromNamespaceOperation::Running, Turbopuffer::Models::CopyFromNamespaceOperation::Finished]
|
|
253
|
+
#
|
|
254
|
+
# @see Turbopuffer::Models::NamespacePollCopyFromParams
|
|
255
|
+
def poll_copy_from(token, params = {})
|
|
256
|
+
parsed, options = Turbopuffer::NamespacePollCopyFromParams.dump_request(params)
|
|
257
|
+
namespace =
|
|
258
|
+
parsed.delete(:namespace) do
|
|
259
|
+
@client.default_namespace
|
|
260
|
+
end
|
|
261
|
+
@client.request(
|
|
262
|
+
method: :get,
|
|
263
|
+
path: ["v1/namespaces/%1$s/operations/%2$s?stainless_overload=pollCopyFrom", namespace, token],
|
|
264
|
+
model: Turbopuffer::CopyFromNamespaceOperation,
|
|
265
|
+
options: options
|
|
266
|
+
)
|
|
267
|
+
end
|
|
268
|
+
|
|
236
269
|
# Some parameter documentations has been truncated, see
|
|
237
270
|
# {Turbopuffer::Models::NamespaceQueryParams} for more details.
|
|
238
271
|
#
|
|
239
272
|
# Query, filter, full-text search and vector search documents.
|
|
240
273
|
#
|
|
241
|
-
# @overload query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
274
|
+
# @overload query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, offset: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
242
275
|
#
|
|
243
276
|
# @param namespace [String] Path param: The name of the namespace.
|
|
244
277
|
#
|
|
@@ -260,6 +293,8 @@ module Turbopuffer
|
|
|
260
293
|
#
|
|
261
294
|
# @param limit [Integer, Turbopuffer::Models::Limit] Body param: Limits the documents returned by a query.
|
|
262
295
|
#
|
|
296
|
+
# @param offset [Integer] Body param: Number of documents to skip before returning results. Supported only
|
|
297
|
+
#
|
|
263
298
|
# @param rank_by [Object] Body param: How to rank the documents in the namespace.
|
|
264
299
|
#
|
|
265
300
|
# @param top_k [Integer] Body param: The number of results to return.
|
|
@@ -350,17 +385,58 @@ module Turbopuffer
|
|
|
350
385
|
)
|
|
351
386
|
end
|
|
352
387
|
|
|
388
|
+
# Some parameter documentations has been truncated, see
|
|
389
|
+
# {Turbopuffer::Models::NamespaceStartCopyFromParams} for more details.
|
|
390
|
+
#
|
|
391
|
+
# Start copying all documents from another namespace into this one. Returns an
|
|
392
|
+
# operation token without waiting for the copy to finish. Use the token to poll
|
|
393
|
+
# for progress and the result.
|
|
394
|
+
#
|
|
395
|
+
# @overload start_copy_from(source_namespace:, namespace: nil, dest_encryption: nil, source_api_key: nil, source_region: nil, request_options: {})
|
|
396
|
+
#
|
|
397
|
+
# @param source_namespace [String] Body param: The namespace to copy documents from.
|
|
398
|
+
#
|
|
399
|
+
# @param namespace [String] Path param: The name of the namespace.
|
|
400
|
+
#
|
|
401
|
+
# @param dest_encryption [Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default] Body param: (Optional) The encryption configuration for the destination namespac
|
|
402
|
+
#
|
|
403
|
+
# @param source_api_key [String] Body param: (Optional) An API key for the organization containing the source nam
|
|
404
|
+
#
|
|
405
|
+
# @param source_region [String] Body param: (Optional) The region of the source namespace.
|
|
406
|
+
#
|
|
407
|
+
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
408
|
+
#
|
|
409
|
+
# @return [Turbopuffer::Models::NamespaceStartCopyFromResponse]
|
|
410
|
+
#
|
|
411
|
+
# @see Turbopuffer::Models::NamespaceStartCopyFromParams
|
|
412
|
+
def start_copy_from(params)
|
|
413
|
+
parsed, options = Turbopuffer::NamespaceStartCopyFromParams.dump_request(params)
|
|
414
|
+
namespace =
|
|
415
|
+
parsed.delete(:namespace) do
|
|
416
|
+
@client.default_namespace
|
|
417
|
+
end
|
|
418
|
+
@client.request(
|
|
419
|
+
method: :post,
|
|
420
|
+
path: ["v2/namespaces/%1$s/async?stainless_overload=startCopyFrom", namespace],
|
|
421
|
+
body: {copy_from_namespace: parsed},
|
|
422
|
+
model: Turbopuffer::Models::NamespaceStartCopyFromResponse,
|
|
423
|
+
options: options
|
|
424
|
+
)
|
|
425
|
+
end
|
|
426
|
+
|
|
353
427
|
# Some parameter documentations has been truncated, see
|
|
354
428
|
# {Turbopuffer::Models::NamespaceUpdateMetadataParams} for more details.
|
|
355
429
|
#
|
|
356
430
|
# Update metadata configuration for a namespace.
|
|
357
431
|
#
|
|
358
|
-
# @overload update_metadata(namespace: nil, pinning: nil, request_options: {})
|
|
432
|
+
# @overload update_metadata(namespace: nil, pinning: nil, read_only: nil, request_options: {})
|
|
359
433
|
#
|
|
360
434
|
# @param namespace [String] Path param: The name of the namespace.
|
|
361
435
|
#
|
|
362
436
|
# @param pinning [Boolean, Turbopuffer::Models::PinningConfig, nil] Body param: Configuration for namespace pinning.
|
|
363
437
|
#
|
|
438
|
+
# @param read_only [Boolean] Body param: Set to `true` to reject document and schema writes, or `false` to al
|
|
439
|
+
#
|
|
364
440
|
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
365
441
|
#
|
|
366
442
|
# @return [Turbopuffer::Models::NamespaceMetadata]
|
data/lib/turbopuffer/version.rb
CHANGED
data/lib/turbopuffer.rb
CHANGED
|
@@ -68,6 +68,8 @@ require_relative "turbopuffer/models/client_namespaces_params"
|
|
|
68
68
|
require_relative "turbopuffer/models/columns"
|
|
69
69
|
require_relative "turbopuffer/models/contains_all_tokens_filter_params"
|
|
70
70
|
require_relative "turbopuffer/models/contains_any_token_filter_params"
|
|
71
|
+
require_relative "turbopuffer/models/copy_from_namespace_operation"
|
|
72
|
+
require_relative "turbopuffer/models/copy_from_namespace_operation_result"
|
|
71
73
|
require_relative "turbopuffer/models/copy_from_namespace_params"
|
|
72
74
|
require_relative "turbopuffer/models/decay_params"
|
|
73
75
|
require_relative "turbopuffer/models/distance_metric"
|
|
@@ -98,20 +100,25 @@ require_relative "turbopuffer/models/namespace_metadata"
|
|
|
98
100
|
require_relative "turbopuffer/models/namespace_metadata_params"
|
|
99
101
|
require_relative "turbopuffer/models/namespace_multi_query_params"
|
|
100
102
|
require_relative "turbopuffer/models/namespace_multi_query_response"
|
|
103
|
+
require_relative "turbopuffer/models/namespace_poll_copy_from_params"
|
|
101
104
|
require_relative "turbopuffer/models/namespace_query_params"
|
|
102
105
|
require_relative "turbopuffer/models/namespace_query_response"
|
|
103
106
|
require_relative "turbopuffer/models/namespace_recall_params"
|
|
104
107
|
require_relative "turbopuffer/models/namespace_recall_response"
|
|
105
108
|
require_relative "turbopuffer/models/namespace_schema_params"
|
|
106
109
|
require_relative "turbopuffer/models/namespace_schema_response"
|
|
110
|
+
require_relative "turbopuffer/models/namespace_start_copy_from_params"
|
|
111
|
+
require_relative "turbopuffer/models/namespace_start_copy_from_response"
|
|
107
112
|
require_relative "turbopuffer/models/namespace_summary"
|
|
108
113
|
require_relative "turbopuffer/models/namespace_update_metadata_params"
|
|
109
114
|
require_relative "turbopuffer/models/namespace_update_schema_params"
|
|
110
115
|
require_relative "turbopuffer/models/namespace_update_schema_response"
|
|
111
116
|
require_relative "turbopuffer/models/namespace_write_params"
|
|
112
117
|
require_relative "turbopuffer/models/namespace_write_response"
|
|
118
|
+
require_relative "turbopuffer/models/operation_error"
|
|
113
119
|
require_relative "turbopuffer/models/query_billing"
|
|
114
120
|
require_relative "turbopuffer/models/query_performance"
|
|
121
|
+
require_relative "turbopuffer/models/rerank_limit"
|
|
115
122
|
require_relative "turbopuffer/models/row"
|
|
116
123
|
require_relative "turbopuffer/models/rrf_params"
|
|
117
124
|
require_relative "turbopuffer/models/saturate_params"
|
|
@@ -122,6 +129,7 @@ require_relative "turbopuffer/models/vector"
|
|
|
122
129
|
require_relative "turbopuffer/models/vector_encoding"
|
|
123
130
|
require_relative "turbopuffer/models/write_billing"
|
|
124
131
|
require_relative "turbopuffer/models/write_performance"
|
|
132
|
+
require_relative "turbopuffer/models/write_result"
|
|
125
133
|
require_relative "turbopuffer/models"
|
|
126
134
|
require_relative "turbopuffer/resources/namespaces"
|
|
127
135
|
require_relative "turbopuffer/namespace"
|
data/rbi/turbopuffer/client.rbi
CHANGED
|
@@ -10,7 +10,7 @@ module Turbopuffer
|
|
|
10
10
|
|
|
11
11
|
DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float)
|
|
12
12
|
|
|
13
|
-
# API key used for authentication
|
|
13
|
+
# API key used for authentication.
|
|
14
14
|
sig { returns(String) }
|
|
15
15
|
attr_reader :api_key
|
|
16
16
|
|
|
@@ -73,7 +73,7 @@ module Turbopuffer
|
|
|
73
73
|
).returns(T.attached_class)
|
|
74
74
|
end
|
|
75
75
|
def self.new(
|
|
76
|
-
# API key used for authentication Defaults to `ENV["TURBOPUFFER_API_KEY"]`
|
|
76
|
+
# API key used for authentication. Defaults to `ENV["TURBOPUFFER_API_KEY"]`
|
|
77
77
|
api_key: ENV["TURBOPUFFER_API_KEY"],
|
|
78
78
|
# The turbopuffer region to use. Defaults to `ENV["TURBOPUFFER_REGION"]`
|
|
79
79
|
region: ENV["TURBOPUFFER_REGION"],
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
# The current status of a copy operation.
|
|
6
|
+
module CopyFromNamespaceOperation
|
|
7
|
+
extend Turbopuffer::Internal::Type::Union
|
|
8
|
+
|
|
9
|
+
Variants =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
Turbopuffer::CopyFromNamespaceOperation::Running,
|
|
13
|
+
Turbopuffer::CopyFromNamespaceOperation::Finished
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
class Running < Turbopuffer::Internal::Type::BaseModel
|
|
18
|
+
OrHash =
|
|
19
|
+
T.type_alias do
|
|
20
|
+
T.any(
|
|
21
|
+
Turbopuffer::CopyFromNamespaceOperation::Running,
|
|
22
|
+
Turbopuffer::Internal::AnyHash
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# The time at which the operation started.
|
|
27
|
+
sig { returns(Time) }
|
|
28
|
+
attr_accessor :start_time
|
|
29
|
+
|
|
30
|
+
sig { returns(Symbol) }
|
|
31
|
+
attr_accessor :status
|
|
32
|
+
|
|
33
|
+
# A freeform description of the operation's progress. May be absent, and its
|
|
34
|
+
# format may change.
|
|
35
|
+
sig { returns(T.nilable(String)) }
|
|
36
|
+
attr_reader :progress
|
|
37
|
+
|
|
38
|
+
sig { params(progress: String).void }
|
|
39
|
+
attr_writer :progress
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
params(start_time: Time, progress: String, status: Symbol).returns(
|
|
43
|
+
T.attached_class
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
def self.new(
|
|
47
|
+
# The time at which the operation started.
|
|
48
|
+
start_time:,
|
|
49
|
+
# A freeform description of the operation's progress. May be absent, and its
|
|
50
|
+
# format may change.
|
|
51
|
+
progress: nil,
|
|
52
|
+
status: :running
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
override.returns(
|
|
58
|
+
{ start_time: Time, status: Symbol, progress: String }
|
|
59
|
+
)
|
|
60
|
+
end
|
|
61
|
+
def to_hash
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class Finished < Turbopuffer::Internal::Type::BaseModel
|
|
66
|
+
OrHash =
|
|
67
|
+
T.type_alias do
|
|
68
|
+
T.any(
|
|
69
|
+
Turbopuffer::CopyFromNamespaceOperation::Finished,
|
|
70
|
+
Turbopuffer::Internal::AnyHash
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# The time at which the operation finished.
|
|
75
|
+
sig { returns(Time) }
|
|
76
|
+
attr_accessor :finish_time
|
|
77
|
+
|
|
78
|
+
sig { returns(Turbopuffer::CopyFromNamespaceOperationResult::Variants) }
|
|
79
|
+
attr_accessor :result
|
|
80
|
+
|
|
81
|
+
# The time at which the operation started.
|
|
82
|
+
sig { returns(Time) }
|
|
83
|
+
attr_accessor :start_time
|
|
84
|
+
|
|
85
|
+
sig { returns(Symbol) }
|
|
86
|
+
attr_accessor :status
|
|
87
|
+
|
|
88
|
+
sig do
|
|
89
|
+
params(
|
|
90
|
+
finish_time: Time,
|
|
91
|
+
result:
|
|
92
|
+
T.any(
|
|
93
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Success::OrHash,
|
|
94
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Error::OrHash
|
|
95
|
+
),
|
|
96
|
+
start_time: Time,
|
|
97
|
+
status: Symbol
|
|
98
|
+
).returns(T.attached_class)
|
|
99
|
+
end
|
|
100
|
+
def self.new(
|
|
101
|
+
# The time at which the operation finished.
|
|
102
|
+
finish_time:,
|
|
103
|
+
result:,
|
|
104
|
+
# The time at which the operation started.
|
|
105
|
+
start_time:,
|
|
106
|
+
status: :finished
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
sig do
|
|
111
|
+
override.returns(
|
|
112
|
+
{
|
|
113
|
+
finish_time: Time,
|
|
114
|
+
result: Turbopuffer::CopyFromNamespaceOperationResult::Variants,
|
|
115
|
+
start_time: Time,
|
|
116
|
+
status: Symbol
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
def to_hash
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
sig do
|
|
125
|
+
override.returns(
|
|
126
|
+
T::Array[Turbopuffer::CopyFromNamespaceOperation::Variants]
|
|
127
|
+
)
|
|
128
|
+
end
|
|
129
|
+
def self.variants
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
module CopyFromNamespaceOperationResult
|
|
6
|
+
extend Turbopuffer::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
Variants =
|
|
9
|
+
T.type_alias do
|
|
10
|
+
T.any(
|
|
11
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Success,
|
|
12
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Error
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class Success < Turbopuffer::Internal::Type::BaseModel
|
|
17
|
+
OrHash =
|
|
18
|
+
T.type_alias do
|
|
19
|
+
T.any(
|
|
20
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Success,
|
|
21
|
+
Turbopuffer::Internal::AnyHash
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# The response to a successful write request.
|
|
26
|
+
sig { returns(Turbopuffer::WriteResult) }
|
|
27
|
+
attr_reader :success
|
|
28
|
+
|
|
29
|
+
sig { params(success: Turbopuffer::WriteResult::OrHash).void }
|
|
30
|
+
attr_writer :success
|
|
31
|
+
|
|
32
|
+
sig do
|
|
33
|
+
params(success: Turbopuffer::WriteResult::OrHash).returns(
|
|
34
|
+
T.attached_class
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
def self.new(
|
|
38
|
+
# The response to a successful write request.
|
|
39
|
+
success:
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
sig { override.returns({ success: Turbopuffer::WriteResult }) }
|
|
44
|
+
def to_hash
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class Error < Turbopuffer::Internal::Type::BaseModel
|
|
49
|
+
OrHash =
|
|
50
|
+
T.type_alias do
|
|
51
|
+
T.any(
|
|
52
|
+
Turbopuffer::CopyFromNamespaceOperationResult::Error,
|
|
53
|
+
Turbopuffer::Internal::AnyHash
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
sig { returns(Turbopuffer::OperationError) }
|
|
58
|
+
attr_reader :error
|
|
59
|
+
|
|
60
|
+
sig { params(error: Turbopuffer::OperationError::OrHash).void }
|
|
61
|
+
attr_writer :error
|
|
62
|
+
|
|
63
|
+
sig do
|
|
64
|
+
params(error: Turbopuffer::OperationError::OrHash).returns(
|
|
65
|
+
T.attached_class
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
def self.new(error:)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
sig { override.returns({ error: Turbopuffer::OperationError }) }
|
|
72
|
+
def to_hash
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
override.returns(
|
|
78
|
+
T::Array[Turbopuffer::CopyFromNamespaceOperationResult::Variants]
|
|
79
|
+
)
|
|
80
|
+
end
|
|
81
|
+
def self.variants
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -104,6 +104,14 @@ module Turbopuffer
|
|
|
104
104
|
sig { params(limit: T.any(Integer, Turbopuffer::Limit::OrHash)).void }
|
|
105
105
|
attr_writer :limit
|
|
106
106
|
|
|
107
|
+
# Number of documents to skip before returning results. Supported only in v2
|
|
108
|
+
# queries with an explicit `rank_by` and `top_k` or `limit`.
|
|
109
|
+
sig { returns(T.nilable(Integer)) }
|
|
110
|
+
attr_reader :offset
|
|
111
|
+
|
|
112
|
+
sig { params(offset: Integer).void }
|
|
113
|
+
attr_writer :offset
|
|
114
|
+
|
|
107
115
|
# How to rank the documents in the namespace.
|
|
108
116
|
sig { returns(T.nilable(T.anything)) }
|
|
109
117
|
attr_reader :rank_by
|
|
@@ -140,6 +148,7 @@ module Turbopuffer
|
|
|
140
148
|
group_by: T::Array[T.anything],
|
|
141
149
|
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
|
142
150
|
limit: T.any(Integer, Turbopuffer::Limit::OrHash),
|
|
151
|
+
offset: Integer,
|
|
143
152
|
rank_by: T.anything,
|
|
144
153
|
top_k: Integer,
|
|
145
154
|
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
|
@@ -172,6 +181,9 @@ module Turbopuffer
|
|
|
172
181
|
include_attributes: nil,
|
|
173
182
|
# Limits the documents returned by a query.
|
|
174
183
|
limit: nil,
|
|
184
|
+
# Number of documents to skip before returning results. Supported only in v2
|
|
185
|
+
# queries with an explicit `rank_by` and `top_k` or `limit`.
|
|
186
|
+
offset: nil,
|
|
175
187
|
# How to rank the documents in the namespace.
|
|
176
188
|
rank_by: nil,
|
|
177
189
|
# The number of results to return.
|
|
@@ -195,6 +207,7 @@ module Turbopuffer
|
|
|
195
207
|
group_by: T::Array[T.anything],
|
|
196
208
|
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
|
197
209
|
limit: T.any(Integer, Turbopuffer::Limit),
|
|
210
|
+
offset: Integer,
|
|
198
211
|
rank_by: T.anything,
|
|
199
212
|
top_k: Integer,
|
|
200
213
|
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|