turbopuffer 1.2.0 → 1.4.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 +48 -0
- data/README.md +1 -1
- data/lib/turbopuffer/file_part.rb +10 -7
- data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +7 -10
- data/lib/turbopuffer/internal/type/file_input.rb +7 -4
- data/lib/turbopuffer/internal/util.rb +7 -6
- data/lib/turbopuffer/models/attribute_schema.rb +1 -1
- data/lib/turbopuffer/models/attribute_schema_config.rb +4 -3
- data/lib/turbopuffer/models/bm25_clause_params.rb +18 -0
- data/lib/turbopuffer/models/contains_all_tokens_filter_params.rb +18 -0
- data/lib/turbopuffer/models/namespace_write_params.rb +9 -1
- data/lib/turbopuffer/models.rb +4 -0
- data/lib/turbopuffer/resources/namespaces.rb +4 -2
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +2 -0
- data/rbi/turbopuffer/file_part.rbi +1 -1
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +6 -4
- data/rbi/turbopuffer/models/bm25_clause_params.rbi +31 -0
- data/rbi/turbopuffer/models/contains_all_tokens_filter_params.rbi +34 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +11 -0
- data/rbi/turbopuffer/models.rbi +5 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +5 -1
- data/sig/turbopuffer/file_part.rbs +1 -1
- data/sig/turbopuffer/models/bm25_clause_params.rbs +15 -0
- data/sig/turbopuffer/models/contains_all_tokens_filter_params.rbs +15 -0
- data/sig/turbopuffer/models/namespace_write_params.rbs +7 -0
- data/sig/turbopuffer/models.rbs +4 -0
- data/sig/turbopuffer/resources/namespaces.rbs +1 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42eb95384e9c94a7cc1e8dfea77930d227c6b694f42894337432279a22236c99
|
4
|
+
data.tar.gz: 57c08feda85626bc9fbbd5198dba60455e379ba648ee59fb44e983dbae46b2eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d773caf2fe0e92fd6acf8effba09b5c3df6c54e074f269480d21d5dfd5a7a850e5a0f02ca943df2cf3ad6e2cbaa80b34ce8ad683d934ec6b0bcc858218e354a
|
7
|
+
data.tar.gz: 8e1433a207658e6a44e0b4591e67836c2ea88b1dea16e7c2509b4a8b0b7ba0abf30e296c7662fcdf72ee816b056ea2f9eed231190291f6c86751259473eb4a46
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,53 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.4.0 (2025-10-15)
|
4
|
+
|
5
|
+
Full Changelog: [v1.3.0...v1.4.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.3.0...v1.4.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* Add float, []float and []bool to the list of valid types in the OpenAPI spec. ([0b809b3](https://github.com/turbopuffer/turbopuffer-ruby/commit/0b809b331e6a9e2121f440e26f47752ac2492459))
|
10
|
+
* Promote disable_backpressure to first-class Write property ([96b020d](https://github.com/turbopuffer/turbopuffer-ruby/commit/96b020d754bfcef28e285c4fdb6c33aff85c502b))
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* absolutely qualified uris should always override the default ([7497b77](https://github.com/turbopuffer/turbopuffer-ruby/commit/7497b770a28cea22db5059aa1506ea316a445dc0))
|
16
|
+
* always send `filename=...` for multipart requests where a file is expected ([155e39b](https://github.com/turbopuffer/turbopuffer-ruby/commit/155e39bd218655c654daa3815b67f373e7879730))
|
17
|
+
* coroutine leaks from connection pool ([be9b5c2](https://github.com/turbopuffer/turbopuffer-ruby/commit/be9b5c20c1d73951996136b5db5ffb0f004e7530))
|
18
|
+
* **internal:** use null byte as file separator in the fast formatting script ([c14be00](https://github.com/turbopuffer/turbopuffer-ruby/commit/c14be00b6284b7ba0c6167a1745b7f72077a7f3a))
|
19
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([a128bba](https://github.com/turbopuffer/turbopuffer-ruby/commit/a128bba556db8a9a0143ee64577c4bd2f5bbf495))
|
20
|
+
* should not reuse buffers for `IO.copy_stream` interop ([e1d1753](https://github.com/turbopuffer/turbopuffer-ruby/commit/e1d1753c2dd07742617dfa605229581028fa34a8))
|
21
|
+
|
22
|
+
|
23
|
+
### Performance Improvements
|
24
|
+
|
25
|
+
* faster code formatting ([4b2b9b8](https://github.com/turbopuffer/turbopuffer-ruby/commit/4b2b9b87406f19b32283ed7ef4f5eea147b41ffb))
|
26
|
+
|
27
|
+
|
28
|
+
### Chores
|
29
|
+
|
30
|
+
* allow fast-format to use bsd sed as well ([9ba0c7d](https://github.com/turbopuffer/turbopuffer-ruby/commit/9ba0c7dd793d88af2e07d9ddfff1a2f49810ac65))
|
31
|
+
* ignore linter error for tests having large collections ([c6a3403](https://github.com/turbopuffer/turbopuffer-ruby/commit/c6a34033c8a3476ebd0197c5435e637c9619a506))
|
32
|
+
|
33
|
+
|
34
|
+
### Documentation
|
35
|
+
|
36
|
+
* hint_cache_warm also update header and openapi ([91dd701](https://github.com/turbopuffer/turbopuffer-ruby/commit/91dd701d5221b5e245de2a14af0c5afcbee58123))
|
37
|
+
|
38
|
+
## 1.3.0 (2025-09-19)
|
39
|
+
|
40
|
+
Full Changelog: [v1.2.0...v1.3.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.2.0...v1.3.0)
|
41
|
+
|
42
|
+
### Features
|
43
|
+
|
44
|
+
* add WithParams variant to BM25 and ContainsAllTokens ([77c2acc](https://github.com/turbopuffer/turbopuffer-ruby/commit/77c2accb00d21ffa454dddd3e381c99082358098))
|
45
|
+
|
46
|
+
|
47
|
+
### Chores
|
48
|
+
|
49
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([923bcb0](https://github.com/turbopuffer/turbopuffer-ruby/commit/923bcb05ff927173b23edc446b075f456df4b332))
|
50
|
+
|
3
51
|
## 1.2.0 (2025-09-17)
|
4
52
|
|
5
53
|
Full Changelog: [v1.1.0...v1.2.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.1.0...v1.2.0)
|
data/README.md
CHANGED
@@ -38,18 +38,21 @@ module Turbopuffer
|
|
38
38
|
def to_yaml(*a) = read.to_yaml(*a)
|
39
39
|
|
40
40
|
# @param content [Pathname, StringIO, IO, String]
|
41
|
-
# @param filename [String, nil]
|
41
|
+
# @param filename [Pathname, String, nil]
|
42
42
|
# @param content_type [String, nil]
|
43
43
|
def initialize(content, filename: nil, content_type: nil)
|
44
|
-
@
|
44
|
+
@content_type = content_type
|
45
45
|
@filename =
|
46
|
-
case content
|
47
|
-
in Pathname
|
48
|
-
|
46
|
+
case [filename, (@content = content)]
|
47
|
+
in [String | Pathname, _]
|
48
|
+
::File.basename(filename)
|
49
|
+
in [nil, Pathname]
|
50
|
+
content.basename.to_path
|
51
|
+
in [nil, IO]
|
52
|
+
content.to_path
|
49
53
|
else
|
50
|
-
filename
|
54
|
+
filename
|
51
55
|
end
|
52
|
-
@content_type = content_type
|
53
56
|
end
|
54
57
|
end
|
55
58
|
end
|
@@ -134,9 +134,9 @@ module Turbopuffer
|
|
134
134
|
|
135
135
|
# rubocop:disable Metrics/BlockLength
|
136
136
|
enum = Enumerator.new do |y|
|
137
|
-
|
138
|
-
next if finished
|
137
|
+
next if finished
|
139
138
|
|
139
|
+
with_pool(url, deadline: deadline) do |conn|
|
140
140
|
req, closing = self.class.build_request(request) do
|
141
141
|
self.class.calibrate_socket_timeout(conn, deadline)
|
142
142
|
end
|
@@ -149,7 +149,7 @@ module Turbopuffer
|
|
149
149
|
|
150
150
|
self.class.calibrate_socket_timeout(conn, deadline)
|
151
151
|
conn.request(req) do |rsp|
|
152
|
-
y << [
|
152
|
+
y << [req, rsp]
|
153
153
|
break if finished
|
154
154
|
|
155
155
|
rsp.read_body do |bytes|
|
@@ -160,6 +160,8 @@ module Turbopuffer
|
|
160
160
|
end
|
161
161
|
eof = true
|
162
162
|
end
|
163
|
+
ensure
|
164
|
+
conn.finish if !eof && conn&.started?
|
163
165
|
end
|
164
166
|
rescue Timeout::Error
|
165
167
|
raise Turbopuffer::Errors::APITimeoutError.new(url: url, request: req)
|
@@ -168,16 +170,11 @@ module Turbopuffer
|
|
168
170
|
end
|
169
171
|
# rubocop:enable Metrics/BlockLength
|
170
172
|
|
171
|
-
|
173
|
+
_, response = enum.next
|
172
174
|
body = Turbopuffer::Internal::Util.fused_enum(enum, external: true) do
|
173
175
|
finished = true
|
174
|
-
|
175
|
-
enum.next
|
176
|
-
rescue StopIteration
|
177
|
-
nil
|
178
|
-
end
|
176
|
+
loop { enum.next }
|
179
177
|
ensure
|
180
|
-
conn.finish if !eof && conn&.started?
|
181
178
|
closing&.call
|
182
179
|
end
|
183
180
|
[Integer(response.code), response, body]
|
@@ -82,17 +82,20 @@ module Turbopuffer
|
|
82
82
|
#
|
83
83
|
# @return [Pathname, StringIO, IO, String, Object]
|
84
84
|
def dump(value, state:)
|
85
|
-
# rubocop:disable Lint/DuplicateBranch
|
86
85
|
case value
|
86
|
+
in StringIO | String
|
87
|
+
# https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
|
88
|
+
# while not required, a filename is recommended, and in practice many servers do expect this
|
89
|
+
Turbopuffer::FilePart.new(value, filename: "upload")
|
87
90
|
in IO
|
88
91
|
state[:can_retry] = false
|
92
|
+
value.to_path.nil? ? Turbopuffer::FilePart.new(value, filename: "upload") : value
|
89
93
|
in Turbopuffer::FilePart if value.content.is_a?(IO)
|
90
94
|
state[:can_retry] = false
|
95
|
+
value
|
91
96
|
else
|
97
|
+
value
|
92
98
|
end
|
93
|
-
# rubocop:enable Lint/DuplicateBranch
|
94
|
-
|
95
|
-
value
|
96
99
|
end
|
97
100
|
|
98
101
|
# @api private
|
@@ -346,8 +346,9 @@ module Turbopuffer
|
|
346
346
|
base_path, base_query = lhs.fetch_values(:path, :query)
|
347
347
|
slashed = base_path.end_with?("/") ? base_path : "#{base_path}/"
|
348
348
|
|
349
|
-
|
350
|
-
|
349
|
+
merged = {**parse_uri(rhs.fetch(:path)), **rhs.except(:path, :query)}
|
350
|
+
parsed_path, parsed_query = merged.fetch_values(:path, :query)
|
351
|
+
override = URI::Generic.build(**merged.slice(:scheme, :host, :port), path: parsed_path)
|
351
352
|
|
352
353
|
joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override)
|
353
354
|
query = deep_merge(
|
@@ -473,10 +474,9 @@ module Turbopuffer
|
|
473
474
|
# @return [Enumerable<String>]
|
474
475
|
def writable_enum(&blk)
|
475
476
|
Enumerator.new do |y|
|
476
|
-
buf = String.new
|
477
477
|
y.define_singleton_method(:write) do
|
478
|
-
self <<
|
479
|
-
|
478
|
+
self << _1.dup
|
479
|
+
_1.bytesize
|
480
480
|
end
|
481
481
|
|
482
482
|
blk.call(y)
|
@@ -566,7 +566,8 @@ module Turbopuffer
|
|
566
566
|
#
|
567
567
|
# @return [Array(String, Enumerable<String>)]
|
568
568
|
private def encode_multipart_streaming(body)
|
569
|
-
|
569
|
+
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
570
|
+
boundary = SecureRandom.urlsafe_base64(46)
|
570
571
|
|
571
572
|
closing = []
|
572
573
|
strio = writable_enum do |y|
|
@@ -6,7 +6,7 @@ module Turbopuffer
|
|
6
6
|
module AttributeSchema
|
7
7
|
extend Turbopuffer::Internal::Type::Union
|
8
8
|
|
9
|
-
# The data type of the attribute. Valid values: string, int, uint, uuid, datetime, bool, []string, []int, []uint, []uuid, []datetime, [DIMS]f16, [DIMS]f32.
|
9
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid, datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool, [DIMS]f16, [DIMS]f32.
|
10
10
|
variant -> { Turbopuffer::AttributeType }
|
11
11
|
|
12
12
|
# Detailed configuration for an attribute attached to a document.
|
@@ -30,8 +30,9 @@ module Turbopuffer
|
|
30
30
|
optional :regex, Turbopuffer::Internal::Type::Boolean
|
31
31
|
|
32
32
|
# @!attribute type
|
33
|
-
# The data type of the attribute. Valid values: string, int, uint,
|
34
|
-
# bool, []string, []int, []uint, []
|
33
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
34
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
35
|
+
# [DIMS]f16, [DIMS]f32.
|
35
36
|
#
|
36
37
|
# @return [String, nil]
|
37
38
|
optional :type, String
|
@@ -50,7 +51,7 @@ module Turbopuffer
|
|
50
51
|
#
|
51
52
|
# @param regex [Boolean] Whether to enable Regex filters on this attribute.
|
52
53
|
#
|
53
|
-
# @param type [String] The data type of the attribute. Valid values: string, int, uint, uuid,
|
54
|
+
# @param type [String] The data type of the attribute. Valid values: string, int, uint, float, uuid, da
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class Bm25ClauseParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
# @!attribute last_as_prefix
|
7
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
8
|
+
#
|
9
|
+
# @return [Boolean, nil]
|
10
|
+
optional :last_as_prefix, Turbopuffer::Internal::Type::Boolean
|
11
|
+
|
12
|
+
# @!method initialize(last_as_prefix: nil)
|
13
|
+
# Additional (optional) parameters for a single BM25 query clause.
|
14
|
+
#
|
15
|
+
# @param last_as_prefix [Boolean] Whether to treat the last token in the query input as a literal prefix.
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class ContainsAllTokensFilterParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
# @!attribute last_as_prefix
|
7
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
8
|
+
#
|
9
|
+
# @return [Boolean, nil]
|
10
|
+
optional :last_as_prefix, Turbopuffer::Internal::Type::Boolean
|
11
|
+
|
12
|
+
# @!method initialize(last_as_prefix: nil)
|
13
|
+
# Additional (optional) parameters for the ContainsAllTokens filter.
|
14
|
+
#
|
15
|
+
# @param last_as_prefix [Boolean] Whether to treat the last token in the query input as a literal prefix.
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -36,6 +36,12 @@ module Turbopuffer
|
|
36
36
|
# @return [Array<String, Integer>, nil]
|
37
37
|
optional :deletes, -> { Turbopuffer::Internal::Type::ArrayOf[union: Turbopuffer::ID] }
|
38
38
|
|
39
|
+
# @!attribute disable_backpressure
|
40
|
+
# Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
41
|
+
#
|
42
|
+
# @return [Boolean, nil]
|
43
|
+
optional :disable_backpressure, Turbopuffer::Internal::Type::Boolean
|
44
|
+
|
39
45
|
# @!attribute distance_metric
|
40
46
|
# A function used to calculate vector similarity.
|
41
47
|
#
|
@@ -92,7 +98,7 @@ module Turbopuffer
|
|
92
98
|
# @return [Array<Turbopuffer::Models::Row>, nil]
|
93
99
|
optional :upsert_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
|
94
100
|
|
95
|
-
# @!method initialize(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_condition: nil, deletes: nil, distance_metric: nil, encryption: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
101
|
+
# @!method initialize(namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
96
102
|
# Some parameter documentations has been truncated, see
|
97
103
|
# {Turbopuffer::Models::NamespaceWriteParams} for more details.
|
98
104
|
#
|
@@ -106,6 +112,8 @@ module Turbopuffer
|
|
106
112
|
#
|
107
113
|
# @param deletes [Array<String, Integer>]
|
108
114
|
#
|
115
|
+
# @param disable_backpressure [Boolean] Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
116
|
+
#
|
109
117
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
110
118
|
#
|
111
119
|
# @param encryption [Turbopuffer::Models::NamespaceWriteParams::Encryption] The encryption configuration for a namespace.
|
data/lib/turbopuffer/models.rb
CHANGED
@@ -48,10 +48,14 @@ module Turbopuffer
|
|
48
48
|
|
49
49
|
AttributeType = Turbopuffer::Models::AttributeType
|
50
50
|
|
51
|
+
Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
|
52
|
+
|
51
53
|
ClientNamespacesParams = Turbopuffer::Models::ClientNamespacesParams
|
52
54
|
|
53
55
|
Columns = Turbopuffer::Models::Columns
|
54
56
|
|
57
|
+
ContainsAllTokensFilterParams = Turbopuffer::Models::ContainsAllTokensFilterParams
|
58
|
+
|
55
59
|
DistanceMetric = Turbopuffer::Models::DistanceMetric
|
56
60
|
|
57
61
|
FullTextSearch = Turbopuffer::Models::FullTextSearch
|
@@ -77,7 +77,7 @@ module Turbopuffer
|
|
77
77
|
)
|
78
78
|
end
|
79
79
|
|
80
|
-
#
|
80
|
+
# Signal turbopuffer to prepare for low-latency requests.
|
81
81
|
#
|
82
82
|
# @overload hint_cache_warm(namespace: nil, request_options: {})
|
83
83
|
#
|
@@ -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_condition: nil, deletes: nil, distance_metric: nil, encryption: 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_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_columns: nil, patch_condition: nil, patch_rows: 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,6 +317,8 @@ module Turbopuffer
|
|
317
317
|
#
|
318
318
|
# @param deletes [Array<String, Integer>] Body param:
|
319
319
|
#
|
320
|
+
# @param disable_backpressure [Boolean] Body param: Disables write throttling (HTTP 429 responses) during high-volume in
|
321
|
+
#
|
320
322
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] Body param: A function used to calculate vector similarity.
|
321
323
|
#
|
322
324
|
# @param encryption [Turbopuffer::Models::NamespaceWriteParams::Encryption] Body param: The encryption configuration for a namespace.
|
data/lib/turbopuffer/version.rb
CHANGED
data/lib/turbopuffer.rb
CHANGED
@@ -55,8 +55,10 @@ require_relative "turbopuffer/models/aggregation_group"
|
|
55
55
|
require_relative "turbopuffer/models/attribute_schema"
|
56
56
|
require_relative "turbopuffer/models/attribute_schema_config"
|
57
57
|
require_relative "turbopuffer/models/attribute_type"
|
58
|
+
require_relative "turbopuffer/models/bm25_clause_params"
|
58
59
|
require_relative "turbopuffer/models/client_namespaces_params"
|
59
60
|
require_relative "turbopuffer/models/columns"
|
61
|
+
require_relative "turbopuffer/models/contains_all_tokens_filter_params"
|
60
62
|
require_relative "turbopuffer/models/distance_metric"
|
61
63
|
require_relative "turbopuffer/models/full_text_search"
|
62
64
|
require_relative "turbopuffer/models/full_text_search_config"
|
@@ -48,8 +48,9 @@ module Turbopuffer
|
|
48
48
|
sig { params(regex: T::Boolean).void }
|
49
49
|
attr_writer :regex
|
50
50
|
|
51
|
-
# The data type of the attribute. Valid values: string, int, uint,
|
52
|
-
# bool, []string, []int, []uint, []
|
51
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
52
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
53
|
+
# [DIMS]f16, [DIMS]f32.
|
53
54
|
sig { returns(T.nilable(String)) }
|
54
55
|
attr_reader :type
|
55
56
|
|
@@ -78,8 +79,9 @@ module Turbopuffer
|
|
78
79
|
full_text_search: nil,
|
79
80
|
# Whether to enable Regex filters on this attribute.
|
80
81
|
regex: nil,
|
81
|
-
# The data type of the attribute. Valid values: string, int, uint,
|
82
|
-
# bool, []string, []int, []uint, []
|
82
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
83
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
84
|
+
# [DIMS]f16, [DIMS]f32.
|
83
85
|
type: nil
|
84
86
|
)
|
85
87
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class Bm25ClauseParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Turbopuffer::Bm25ClauseParams, Turbopuffer::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
12
|
+
sig { returns(T.nilable(T::Boolean)) }
|
13
|
+
attr_reader :last_as_prefix
|
14
|
+
|
15
|
+
sig { params(last_as_prefix: T::Boolean).void }
|
16
|
+
attr_writer :last_as_prefix
|
17
|
+
|
18
|
+
# Additional (optional) parameters for a single BM25 query clause.
|
19
|
+
sig { params(last_as_prefix: T::Boolean).returns(T.attached_class) }
|
20
|
+
def self.new(
|
21
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
22
|
+
last_as_prefix: nil
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
sig { override.returns({ last_as_prefix: T::Boolean }) }
|
27
|
+
def to_hash
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class ContainsAllTokensFilterParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Turbopuffer::ContainsAllTokensFilterParams,
|
10
|
+
Turbopuffer::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
15
|
+
sig { returns(T.nilable(T::Boolean)) }
|
16
|
+
attr_reader :last_as_prefix
|
17
|
+
|
18
|
+
sig { params(last_as_prefix: T::Boolean).void }
|
19
|
+
attr_writer :last_as_prefix
|
20
|
+
|
21
|
+
# Additional (optional) parameters for the ContainsAllTokens filter.
|
22
|
+
sig { params(last_as_prefix: T::Boolean).returns(T.attached_class) }
|
23
|
+
def self.new(
|
24
|
+
# Whether to treat the last token in the query input as a literal prefix.
|
25
|
+
last_as_prefix: nil
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
sig { override.returns({ last_as_prefix: T::Boolean }) }
|
30
|
+
def to_hash
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -48,6 +48,13 @@ module Turbopuffer
|
|
48
48
|
sig { params(deletes: T::Array[Turbopuffer::ID::Variants]).void }
|
49
49
|
attr_writer :deletes
|
50
50
|
|
51
|
+
# Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
52
|
+
sig { returns(T.nilable(T::Boolean)) }
|
53
|
+
attr_reader :disable_backpressure
|
54
|
+
|
55
|
+
sig { params(disable_backpressure: T::Boolean).void }
|
56
|
+
attr_writer :disable_backpressure
|
57
|
+
|
51
58
|
# A function used to calculate vector similarity.
|
52
59
|
sig { returns(T.nilable(Turbopuffer::DistanceMetric::OrSymbol)) }
|
53
60
|
attr_reader :distance_metric
|
@@ -140,6 +147,7 @@ module Turbopuffer
|
|
140
147
|
delete_by_filter: T.anything,
|
141
148
|
delete_condition: T.anything,
|
142
149
|
deletes: T::Array[Turbopuffer::ID::Variants],
|
150
|
+
disable_backpressure: T::Boolean,
|
143
151
|
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
144
152
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption::OrHash,
|
145
153
|
patch_columns: Turbopuffer::Columns::OrHash,
|
@@ -166,6 +174,8 @@ module Turbopuffer
|
|
166
174
|
# delete write. Only documents that pass the condition are deleted.
|
167
175
|
delete_condition: nil,
|
168
176
|
deletes: nil,
|
177
|
+
# Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
178
|
+
disable_backpressure: nil,
|
169
179
|
# A function used to calculate vector similarity.
|
170
180
|
distance_metric: nil,
|
171
181
|
# The encryption configuration for a namespace.
|
@@ -198,6 +208,7 @@ module Turbopuffer
|
|
198
208
|
delete_by_filter: T.anything,
|
199
209
|
delete_condition: T.anything,
|
200
210
|
deletes: T::Array[Turbopuffer::ID::Variants],
|
211
|
+
disable_backpressure: T::Boolean,
|
201
212
|
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
202
213
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
203
214
|
patch_columns: Turbopuffer::Columns,
|
data/rbi/turbopuffer/models.rbi
CHANGED
@@ -13,10 +13,15 @@ module Turbopuffer
|
|
13
13
|
|
14
14
|
AttributeType = Turbopuffer::Models::AttributeType
|
15
15
|
|
16
|
+
Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
|
17
|
+
|
16
18
|
ClientNamespacesParams = Turbopuffer::Models::ClientNamespacesParams
|
17
19
|
|
18
20
|
Columns = Turbopuffer::Models::Columns
|
19
21
|
|
22
|
+
ContainsAllTokensFilterParams =
|
23
|
+
Turbopuffer::Models::ContainsAllTokensFilterParams
|
24
|
+
|
20
25
|
DistanceMetric = Turbopuffer::Models::DistanceMetric
|
21
26
|
|
22
27
|
FullTextSearch = Turbopuffer::Models::FullTextSearch
|
@@ -66,7 +66,7 @@ module Turbopuffer
|
|
66
66
|
)
|
67
67
|
end
|
68
68
|
|
69
|
-
#
|
69
|
+
# Signal turbopuffer to prepare for low-latency requests.
|
70
70
|
sig do
|
71
71
|
params(
|
72
72
|
namespace: T.nilable(String),
|
@@ -240,6 +240,7 @@ module Turbopuffer
|
|
240
240
|
delete_by_filter: T.anything,
|
241
241
|
delete_condition: T.anything,
|
242
242
|
deletes: T::Array[Turbopuffer::ID::Variants],
|
243
|
+
disable_backpressure: T::Boolean,
|
243
244
|
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
244
245
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption::OrHash,
|
245
246
|
patch_columns: Turbopuffer::Columns::OrHash,
|
@@ -268,6 +269,9 @@ module Turbopuffer
|
|
268
269
|
delete_condition: nil,
|
269
270
|
# Body param:
|
270
271
|
deletes: nil,
|
272
|
+
# Body param: Disables write throttling (HTTP 429 responses) during high-volume
|
273
|
+
# ingestion.
|
274
|
+
disable_backpressure: nil,
|
271
275
|
# Body param: A function used to calculate vector similarity.
|
272
276
|
distance_metric: nil,
|
273
277
|
# Body param: The encryption configuration for a namespace.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type bm25_clause_params = { last_as_prefix: bool }
|
4
|
+
|
5
|
+
class Bm25ClauseParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
attr_reader last_as_prefix: bool?
|
7
|
+
|
8
|
+
def last_as_prefix=: (bool) -> bool
|
9
|
+
|
10
|
+
def initialize: (?last_as_prefix: bool) -> void
|
11
|
+
|
12
|
+
def to_hash: -> { last_as_prefix: bool }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type contains_all_tokens_filter_params = { last_as_prefix: bool }
|
4
|
+
|
5
|
+
class ContainsAllTokensFilterParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
attr_reader last_as_prefix: bool?
|
7
|
+
|
8
|
+
def last_as_prefix=: (bool) -> bool
|
9
|
+
|
10
|
+
def initialize: (?last_as_prefix: bool) -> void
|
11
|
+
|
12
|
+
def to_hash: -> { last_as_prefix: bool }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -7,6 +7,7 @@ module Turbopuffer
|
|
7
7
|
delete_by_filter: top,
|
8
8
|
delete_condition: top,
|
9
9
|
deletes: ::Array[Turbopuffer::Models::id],
|
10
|
+
disable_backpressure: bool,
|
10
11
|
distance_metric: Turbopuffer::Models::distance_metric,
|
11
12
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
12
13
|
patch_columns: Turbopuffer::Columns,
|
@@ -45,6 +46,10 @@ module Turbopuffer
|
|
45
46
|
::Array[Turbopuffer::Models::id]
|
46
47
|
) -> ::Array[Turbopuffer::Models::id]
|
47
48
|
|
49
|
+
attr_reader disable_backpressure: bool?
|
50
|
+
|
51
|
+
def disable_backpressure=: (bool) -> bool
|
52
|
+
|
48
53
|
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
49
54
|
|
50
55
|
def distance_metric=: (
|
@@ -93,6 +98,7 @@ module Turbopuffer
|
|
93
98
|
?delete_by_filter: top,
|
94
99
|
?delete_condition: top,
|
95
100
|
?deletes: ::Array[Turbopuffer::Models::id],
|
101
|
+
?disable_backpressure: bool,
|
96
102
|
?distance_metric: Turbopuffer::Models::distance_metric,
|
97
103
|
?encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
98
104
|
?patch_columns: Turbopuffer::Columns,
|
@@ -111,6 +117,7 @@ module Turbopuffer
|
|
111
117
|
delete_by_filter: top,
|
112
118
|
delete_condition: top,
|
113
119
|
deletes: ::Array[Turbopuffer::Models::id],
|
120
|
+
disable_backpressure: bool,
|
114
121
|
distance_metric: Turbopuffer::Models::distance_metric,
|
115
122
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
116
123
|
patch_columns: Turbopuffer::Columns,
|
data/sig/turbopuffer/models.rbs
CHANGED
@@ -7,10 +7,14 @@ module Turbopuffer
|
|
7
7
|
|
8
8
|
class AttributeType = Turbopuffer::Models::AttributeType
|
9
9
|
|
10
|
+
class Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
|
11
|
+
|
10
12
|
class ClientNamespacesParams = Turbopuffer::Models::ClientNamespacesParams
|
11
13
|
|
12
14
|
class Columns = Turbopuffer::Models::Columns
|
13
15
|
|
16
|
+
class ContainsAllTokensFilterParams = Turbopuffer::Models::ContainsAllTokensFilterParams
|
17
|
+
|
14
18
|
module DistanceMetric = Turbopuffer::Models::DistanceMetric
|
15
19
|
|
16
20
|
module FullTextSearch = Turbopuffer::Models::FullTextSearch
|
@@ -81,6 +81,7 @@ module Turbopuffer
|
|
81
81
|
?delete_by_filter: top,
|
82
82
|
?delete_condition: top,
|
83
83
|
?deletes: ::Array[Turbopuffer::Models::id],
|
84
|
+
?disable_backpressure: bool,
|
84
85
|
?distance_metric: Turbopuffer::Models::distance_metric,
|
85
86
|
?encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
86
87
|
?patch_columns: Turbopuffer::Columns,
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Turbopuffer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -60,8 +60,10 @@ files:
|
|
60
60
|
- lib/turbopuffer/models/attribute_schema.rb
|
61
61
|
- lib/turbopuffer/models/attribute_schema_config.rb
|
62
62
|
- lib/turbopuffer/models/attribute_type.rb
|
63
|
+
- lib/turbopuffer/models/bm25_clause_params.rb
|
63
64
|
- lib/turbopuffer/models/client_namespaces_params.rb
|
64
65
|
- lib/turbopuffer/models/columns.rb
|
66
|
+
- lib/turbopuffer/models/contains_all_tokens_filter_params.rb
|
65
67
|
- lib/turbopuffer/models/distance_metric.rb
|
66
68
|
- lib/turbopuffer/models/full_text_search.rb
|
67
69
|
- lib/turbopuffer/models/full_text_search_config.rb
|
@@ -126,8 +128,10 @@ files:
|
|
126
128
|
- rbi/turbopuffer/models/attribute_schema.rbi
|
127
129
|
- rbi/turbopuffer/models/attribute_schema_config.rbi
|
128
130
|
- rbi/turbopuffer/models/attribute_type.rbi
|
131
|
+
- rbi/turbopuffer/models/bm25_clause_params.rbi
|
129
132
|
- rbi/turbopuffer/models/client_namespaces_params.rbi
|
130
133
|
- rbi/turbopuffer/models/columns.rbi
|
134
|
+
- rbi/turbopuffer/models/contains_all_tokens_filter_params.rbi
|
131
135
|
- rbi/turbopuffer/models/distance_metric.rbi
|
132
136
|
- rbi/turbopuffer/models/full_text_search.rbi
|
133
137
|
- rbi/turbopuffer/models/full_text_search_config.rbi
|
@@ -191,8 +195,10 @@ files:
|
|
191
195
|
- sig/turbopuffer/models/attribute_schema.rbs
|
192
196
|
- sig/turbopuffer/models/attribute_schema_config.rbs
|
193
197
|
- sig/turbopuffer/models/attribute_type.rbs
|
198
|
+
- sig/turbopuffer/models/bm25_clause_params.rbs
|
194
199
|
- sig/turbopuffer/models/client_namespaces_params.rbs
|
195
200
|
- sig/turbopuffer/models/columns.rbs
|
201
|
+
- sig/turbopuffer/models/contains_all_tokens_filter_params.rbs
|
196
202
|
- sig/turbopuffer/models/distance_metric.rbs
|
197
203
|
- sig/turbopuffer/models/full_text_search.rbs
|
198
204
|
- sig/turbopuffer/models/full_text_search_config.rbs
|