turbopuffer 1.3.0 → 1.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 +45 -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/namespace_metadata.rb +113 -1
- data/lib/turbopuffer/models/namespace_write_params.rb +37 -1
- data/lib/turbopuffer/resources/namespaces.rb +6 -2
- data/lib/turbopuffer/version.rb +1 -1
- data/rbi/turbopuffer/file_part.rbi +1 -1
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +6 -4
- data/rbi/turbopuffer/models/namespace_metadata.rbi +225 -3
- data/rbi/turbopuffer/models/namespace_write_params.rbi +69 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +9 -1
- data/sig/turbopuffer/file_part.rbs +1 -1
- data/sig/turbopuffer/models/namespace_metadata.rbs +95 -3
- data/sig/turbopuffer/models/namespace_write_params.rbs +28 -0
- data/sig/turbopuffer/resources/namespaces.rbs +2 -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: a2f5759ef6a54d8d20fd914a7afb761b2f63e9383fe76094336a59d2dd77c887
|
|
4
|
+
data.tar.gz: 6186eaa83038a13743abdc63737933c49666249bf4435067551ac1271c47202e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c1dc39006702ca0bdba4684355c7c4436522fd796c33031b553523808b2ae6486bbc5865a1e55d5986ccafa837c6ac914319f9171914e1391ff9c9e527f116d
|
|
7
|
+
data.tar.gz: 5b77e8508f24ffbac98423426cc270e812f6ef434d50ceab6397cb8b905e4e4e4a8a2f52f62b84c4051afc2955899f74c39cec35ef6039386eae837567ed5908
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0 (2025-10-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.4.0...v1.5.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.4.0...v1.5.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Metadata endpoint updates (e.g. to track indexing progress) ([4e631c7](https://github.com/turbopuffer/turbopuffer-ruby/commit/4e631c73375f784d2be0b7acb58c75d336cf1b2c))
|
|
10
|
+
* required for patch_by_filter :facepalm: ([f075887](https://github.com/turbopuffer/turbopuffer-ruby/commit/f0758879e11152cec2506509b5e558c1a6e143c8))
|
|
11
|
+
* stainless: add patch_by_filter ([da661c2](https://github.com/turbopuffer/turbopuffer-ruby/commit/da661c2d9bf4e8eaf3b70ea9430d22998188a02e))
|
|
12
|
+
|
|
13
|
+
## 1.4.0 (2025-10-15)
|
|
14
|
+
|
|
15
|
+
Full Changelog: [v1.3.0...v1.4.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.3.0...v1.4.0)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add float, []float and []bool to the list of valid types in the OpenAPI spec. ([0b809b3](https://github.com/turbopuffer/turbopuffer-ruby/commit/0b809b331e6a9e2121f440e26f47752ac2492459))
|
|
20
|
+
* Promote disable_backpressure to first-class Write property ([96b020d](https://github.com/turbopuffer/turbopuffer-ruby/commit/96b020d754bfcef28e285c4fdb6c33aff85c502b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* absolutely qualified uris should always override the default ([7497b77](https://github.com/turbopuffer/turbopuffer-ruby/commit/7497b770a28cea22db5059aa1506ea316a445dc0))
|
|
26
|
+
* always send `filename=...` for multipart requests where a file is expected ([155e39b](https://github.com/turbopuffer/turbopuffer-ruby/commit/155e39bd218655c654daa3815b67f373e7879730))
|
|
27
|
+
* coroutine leaks from connection pool ([be9b5c2](https://github.com/turbopuffer/turbopuffer-ruby/commit/be9b5c20c1d73951996136b5db5ffb0f004e7530))
|
|
28
|
+
* **internal:** use null byte as file separator in the fast formatting script ([c14be00](https://github.com/turbopuffer/turbopuffer-ruby/commit/c14be00b6284b7ba0c6167a1745b7f72077a7f3a))
|
|
29
|
+
* shorten multipart boundary sep to less than RFC specificed max length ([a128bba](https://github.com/turbopuffer/turbopuffer-ruby/commit/a128bba556db8a9a0143ee64577c4bd2f5bbf495))
|
|
30
|
+
* should not reuse buffers for `IO.copy_stream` interop ([e1d1753](https://github.com/turbopuffer/turbopuffer-ruby/commit/e1d1753c2dd07742617dfa605229581028fa34a8))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Performance Improvements
|
|
34
|
+
|
|
35
|
+
* faster code formatting ([4b2b9b8](https://github.com/turbopuffer/turbopuffer-ruby/commit/4b2b9b87406f19b32283ed7ef4f5eea147b41ffb))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Chores
|
|
39
|
+
|
|
40
|
+
* allow fast-format to use bsd sed as well ([9ba0c7d](https://github.com/turbopuffer/turbopuffer-ruby/commit/9ba0c7dd793d88af2e07d9ddfff1a2f49810ac65))
|
|
41
|
+
* ignore linter error for tests having large collections ([c6a3403](https://github.com/turbopuffer/turbopuffer-ruby/commit/c6a34033c8a3476ebd0197c5435e637c9619a506))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Documentation
|
|
45
|
+
|
|
46
|
+
* hint_cache_warm also update header and openapi ([91dd701](https://github.com/turbopuffer/turbopuffer-ruby/commit/91dd701d5221b5e245de2a14af0c5afcbee58123))
|
|
47
|
+
|
|
3
48
|
## 1.3.0 (2025-09-19)
|
|
4
49
|
|
|
5
50
|
Full Changelog: [v1.2.0...v1.3.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.2.0...v1.3.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
|
|
@@ -28,7 +28,28 @@ module Turbopuffer
|
|
|
28
28
|
# @return [Hash{Symbol=>Turbopuffer::Models::AttributeSchemaConfig}]
|
|
29
29
|
required :schema, -> { Turbopuffer::Internal::Type::HashOf[Turbopuffer::AttributeSchemaConfig] }
|
|
30
30
|
|
|
31
|
-
# @!
|
|
31
|
+
# @!attribute updated_at
|
|
32
|
+
# The timestamp when the namespace was last modified by a write operation.
|
|
33
|
+
#
|
|
34
|
+
# @return [Time]
|
|
35
|
+
required :updated_at, Time
|
|
36
|
+
|
|
37
|
+
# @!attribute encryption
|
|
38
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
39
|
+
# (CMEK).
|
|
40
|
+
#
|
|
41
|
+
# @return [Boolean, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek, nil]
|
|
42
|
+
optional :encryption, union: -> { Turbopuffer::NamespaceMetadata::Encryption }
|
|
43
|
+
|
|
44
|
+
# @!attribute index
|
|
45
|
+
#
|
|
46
|
+
# @return [Turbopuffer::Models::NamespaceMetadata::Index::Status, Turbopuffer::Models::NamespaceMetadata::Index::UnionMember1, nil]
|
|
47
|
+
optional :index, union: -> { Turbopuffer::NamespaceMetadata::Index }
|
|
48
|
+
|
|
49
|
+
# @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, schema:, updated_at:, encryption: nil, index: nil)
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {Turbopuffer::Models::NamespaceMetadata} for more details.
|
|
52
|
+
#
|
|
32
53
|
# Metadata about a namespace.
|
|
33
54
|
#
|
|
34
55
|
# @param approx_logical_bytes [Integer] The approximate number of logical bytes in the namespace.
|
|
@@ -38,6 +59,97 @@ module Turbopuffer
|
|
|
38
59
|
# @param created_at [Time] The timestamp when the namespace was created.
|
|
39
60
|
#
|
|
40
61
|
# @param schema [Hash{Symbol=>Turbopuffer::Models::AttributeSchemaConfig}] The schema of the namespace.
|
|
62
|
+
#
|
|
63
|
+
# @param updated_at [Time] The timestamp when the namespace was last modified by a write operation.
|
|
64
|
+
#
|
|
65
|
+
# @param encryption [Boolean, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek] Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
66
|
+
#
|
|
67
|
+
# @param index [Turbopuffer::Models::NamespaceMetadata::Index::Status, Turbopuffer::Models::NamespaceMetadata::Index::UnionMember1]
|
|
68
|
+
|
|
69
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
70
|
+
# (CMEK).
|
|
71
|
+
#
|
|
72
|
+
# @see Turbopuffer::Models::NamespaceMetadata#encryption
|
|
73
|
+
module Encryption
|
|
74
|
+
extend Turbopuffer::Internal::Type::Union
|
|
75
|
+
|
|
76
|
+
variant Turbopuffer::Internal::Type::Boolean
|
|
77
|
+
|
|
78
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key (CMEK).
|
|
79
|
+
variant -> { Turbopuffer::NamespaceMetadata::Encryption::Cmek }
|
|
80
|
+
|
|
81
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
82
|
+
# @!attribute cmek
|
|
83
|
+
#
|
|
84
|
+
# @return [Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek::Cmek, nil]
|
|
85
|
+
optional :cmek, -> { Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek }
|
|
86
|
+
|
|
87
|
+
# @!method initialize(cmek: nil)
|
|
88
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
89
|
+
# (CMEK).
|
|
90
|
+
#
|
|
91
|
+
# @param cmek [Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek::Cmek]
|
|
92
|
+
|
|
93
|
+
# @see Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek#cmek
|
|
94
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
95
|
+
# @!attribute key_name
|
|
96
|
+
# The name of the CMEK key in use.
|
|
97
|
+
#
|
|
98
|
+
# @return [String]
|
|
99
|
+
required :key_name, String
|
|
100
|
+
|
|
101
|
+
# @!method initialize(key_name:)
|
|
102
|
+
# @param key_name [String] The name of the CMEK key in use.
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# @!method self.variants
|
|
107
|
+
# @return [Array(Boolean, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek)]
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# @see Turbopuffer::Models::NamespaceMetadata#index
|
|
111
|
+
module Index
|
|
112
|
+
extend Turbopuffer::Internal::Type::Union
|
|
113
|
+
|
|
114
|
+
variant -> { Turbopuffer::NamespaceMetadata::Index::Status }
|
|
115
|
+
|
|
116
|
+
variant -> { Turbopuffer::NamespaceMetadata::Index::UnionMember1 }
|
|
117
|
+
|
|
118
|
+
class Status < Turbopuffer::Internal::Type::BaseModel
|
|
119
|
+
# @!attribute status
|
|
120
|
+
#
|
|
121
|
+
# @return [Symbol, :"up-to-date"]
|
|
122
|
+
required :status, const: :"up-to-date"
|
|
123
|
+
|
|
124
|
+
# @!method initialize(status: :"up-to-date")
|
|
125
|
+
# @param status [Symbol, :"up-to-date"]
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
class UnionMember1 < Turbopuffer::Internal::Type::BaseModel
|
|
129
|
+
# @!attribute status
|
|
130
|
+
#
|
|
131
|
+
# @return [Symbol, :updating]
|
|
132
|
+
required :status, const: :updating
|
|
133
|
+
|
|
134
|
+
# @!attribute unindexed_bytes
|
|
135
|
+
# The number of bytes in the namespace that are in the write-ahead log but have
|
|
136
|
+
# not yet been indexed.
|
|
137
|
+
#
|
|
138
|
+
# @return [Integer]
|
|
139
|
+
required :unindexed_bytes, Integer
|
|
140
|
+
|
|
141
|
+
# @!method initialize(unindexed_bytes:, status: :updating)
|
|
142
|
+
# Some parameter documentations has been truncated, see
|
|
143
|
+
# {Turbopuffer::Models::NamespaceMetadata::Index::UnionMember1} for more details.
|
|
144
|
+
#
|
|
145
|
+
# @param unindexed_bytes [Integer] The number of bytes in the namespace that are in the write-ahead log but have no
|
|
146
|
+
#
|
|
147
|
+
# @param status [Symbol, :updating]
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# @!method self.variants
|
|
151
|
+
# @return [Array(Turbopuffer::Models::NamespaceMetadata::Index::Status, Turbopuffer::Models::NamespaceMetadata::Index::UnionMember1)]
|
|
152
|
+
end
|
|
41
153
|
end
|
|
42
154
|
end
|
|
43
155
|
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
|
#
|
|
@@ -48,6 +54,12 @@ module Turbopuffer
|
|
|
48
54
|
# @return [Turbopuffer::Models::NamespaceWriteParams::Encryption, nil]
|
|
49
55
|
optional :encryption, -> { Turbopuffer::NamespaceWriteParams::Encryption }
|
|
50
56
|
|
|
57
|
+
# @!attribute patch_by_filter
|
|
58
|
+
# The patch and filter specifying which documents to patch.
|
|
59
|
+
#
|
|
60
|
+
# @return [Turbopuffer::Models::NamespaceWriteParams::PatchByFilter, nil]
|
|
61
|
+
optional :patch_by_filter, -> { Turbopuffer::NamespaceWriteParams::PatchByFilter }
|
|
62
|
+
|
|
51
63
|
# @!attribute patch_columns
|
|
52
64
|
# A list of documents in columnar format. Each key is a column name, mapped to an
|
|
53
65
|
# array of values for that column.
|
|
@@ -92,7 +104,7 @@ module Turbopuffer
|
|
|
92
104
|
# @return [Array<Turbopuffer::Models::Row>, nil]
|
|
93
105
|
optional :upsert_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
|
|
94
106
|
|
|
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: {})
|
|
107
|
+
# @!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_by_filter: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
96
108
|
# Some parameter documentations has been truncated, see
|
|
97
109
|
# {Turbopuffer::Models::NamespaceWriteParams} for more details.
|
|
98
110
|
#
|
|
@@ -106,10 +118,14 @@ module Turbopuffer
|
|
|
106
118
|
#
|
|
107
119
|
# @param deletes [Array<String, Integer>]
|
|
108
120
|
#
|
|
121
|
+
# @param disable_backpressure [Boolean] Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
|
122
|
+
#
|
|
109
123
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
110
124
|
#
|
|
111
125
|
# @param encryption [Turbopuffer::Models::NamespaceWriteParams::Encryption] The encryption configuration for a namespace.
|
|
112
126
|
#
|
|
127
|
+
# @param patch_by_filter [Turbopuffer::Models::NamespaceWriteParams::PatchByFilter] The patch and filter specifying which documents to patch.
|
|
128
|
+
#
|
|
113
129
|
# @param patch_columns [Turbopuffer::Models::Columns] A list of documents in columnar format. Each key is a column name, mapped to an
|
|
114
130
|
#
|
|
115
131
|
# @param patch_condition [Object] A condition evaluated against the current value of each document targeted by a p
|
|
@@ -153,6 +169,26 @@ module Turbopuffer
|
|
|
153
169
|
# @param key_name [String] The identifier of the CMEK key to use for encryption. For GCP, the fully-qualifi
|
|
154
170
|
end
|
|
155
171
|
end
|
|
172
|
+
|
|
173
|
+
class PatchByFilter < Turbopuffer::Internal::Type::BaseModel
|
|
174
|
+
# @!attribute filters
|
|
175
|
+
# Filter by attributes. Same syntax as the query endpoint.
|
|
176
|
+
#
|
|
177
|
+
# @return [Object]
|
|
178
|
+
required :filters, Turbopuffer::Internal::Type::Unknown
|
|
179
|
+
|
|
180
|
+
# @!attribute patch
|
|
181
|
+
#
|
|
182
|
+
# @return [Hash{Symbol=>Object}]
|
|
183
|
+
required :patch, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
184
|
+
|
|
185
|
+
# @!method initialize(filters:, patch:)
|
|
186
|
+
# The patch and filter specifying which documents to patch.
|
|
187
|
+
#
|
|
188
|
+
# @param filters [Object] Filter by attributes. Same syntax as the query endpoint.
|
|
189
|
+
#
|
|
190
|
+
# @param patch [Hash{Symbol=>Object}]
|
|
191
|
+
end
|
|
156
192
|
end
|
|
157
193
|
end
|
|
158
194
|
end
|
|
@@ -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_by_filter: 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,10 +317,14 @@ 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.
|
|
323
325
|
#
|
|
326
|
+
# @param patch_by_filter [Turbopuffer::Models::NamespaceWriteParams::PatchByFilter] Body param: The patch and filter specifying which documents to patch.
|
|
327
|
+
#
|
|
324
328
|
# @param patch_columns [Turbopuffer::Models::Columns] Body param: A list of documents in columnar format. Each key is a column name, m
|
|
325
329
|
#
|
|
326
330
|
# @param patch_condition [Object] Body param: A condition evaluated against the current value of each document tar
|
data/lib/turbopuffer/version.rb
CHANGED
|
@@ -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
|
|
@@ -24,13 +24,62 @@ module Turbopuffer
|
|
|
24
24
|
sig { returns(T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]) }
|
|
25
25
|
attr_accessor :schema
|
|
26
26
|
|
|
27
|
+
# The timestamp when the namespace was last modified by a write operation.
|
|
28
|
+
sig { returns(Time) }
|
|
29
|
+
attr_accessor :updated_at
|
|
30
|
+
|
|
31
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
32
|
+
# (CMEK).
|
|
33
|
+
sig do
|
|
34
|
+
returns(T.nilable(Turbopuffer::NamespaceMetadata::Encryption::Variants))
|
|
35
|
+
end
|
|
36
|
+
attr_reader :encryption
|
|
37
|
+
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
encryption:
|
|
41
|
+
T.any(
|
|
42
|
+
T::Boolean,
|
|
43
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::OrHash
|
|
44
|
+
)
|
|
45
|
+
).void
|
|
46
|
+
end
|
|
47
|
+
attr_writer :encryption
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
returns(T.nilable(Turbopuffer::NamespaceMetadata::Index::Variants))
|
|
51
|
+
end
|
|
52
|
+
attr_reader :index
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
index:
|
|
57
|
+
T.any(
|
|
58
|
+
Turbopuffer::NamespaceMetadata::Index::Status::OrHash,
|
|
59
|
+
Turbopuffer::NamespaceMetadata::Index::UnionMember1::OrHash
|
|
60
|
+
)
|
|
61
|
+
).void
|
|
62
|
+
end
|
|
63
|
+
attr_writer :index
|
|
64
|
+
|
|
27
65
|
# Metadata about a namespace.
|
|
28
66
|
sig do
|
|
29
67
|
params(
|
|
30
68
|
approx_logical_bytes: Integer,
|
|
31
69
|
approx_row_count: Integer,
|
|
32
70
|
created_at: Time,
|
|
33
|
-
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig::OrHash]
|
|
71
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig::OrHash],
|
|
72
|
+
updated_at: Time,
|
|
73
|
+
encryption:
|
|
74
|
+
T.any(
|
|
75
|
+
T::Boolean,
|
|
76
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::OrHash
|
|
77
|
+
),
|
|
78
|
+
index:
|
|
79
|
+
T.any(
|
|
80
|
+
Turbopuffer::NamespaceMetadata::Index::Status::OrHash,
|
|
81
|
+
Turbopuffer::NamespaceMetadata::Index::UnionMember1::OrHash
|
|
82
|
+
)
|
|
34
83
|
).returns(T.attached_class)
|
|
35
84
|
end
|
|
36
85
|
def self.new(
|
|
@@ -41,7 +90,13 @@ module Turbopuffer
|
|
|
41
90
|
# The timestamp when the namespace was created.
|
|
42
91
|
created_at:,
|
|
43
92
|
# The schema of the namespace.
|
|
44
|
-
schema
|
|
93
|
+
schema:,
|
|
94
|
+
# The timestamp when the namespace was last modified by a write operation.
|
|
95
|
+
updated_at:,
|
|
96
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
97
|
+
# (CMEK).
|
|
98
|
+
encryption: nil,
|
|
99
|
+
index: nil
|
|
45
100
|
)
|
|
46
101
|
end
|
|
47
102
|
|
|
@@ -51,12 +106,179 @@ module Turbopuffer
|
|
|
51
106
|
approx_logical_bytes: Integer,
|
|
52
107
|
approx_row_count: Integer,
|
|
53
108
|
created_at: Time,
|
|
54
|
-
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
109
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
110
|
+
updated_at: Time,
|
|
111
|
+
encryption: Turbopuffer::NamespaceMetadata::Encryption::Variants,
|
|
112
|
+
index: Turbopuffer::NamespaceMetadata::Index::Variants
|
|
55
113
|
}
|
|
56
114
|
)
|
|
57
115
|
end
|
|
58
116
|
def to_hash
|
|
59
117
|
end
|
|
118
|
+
|
|
119
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
120
|
+
# (CMEK).
|
|
121
|
+
module Encryption
|
|
122
|
+
extend Turbopuffer::Internal::Type::Union
|
|
123
|
+
|
|
124
|
+
Variants =
|
|
125
|
+
T.type_alias do
|
|
126
|
+
T.any(T::Boolean, Turbopuffer::NamespaceMetadata::Encryption::Cmek)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
130
|
+
OrHash =
|
|
131
|
+
T.type_alias do
|
|
132
|
+
T.any(
|
|
133
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek,
|
|
134
|
+
Turbopuffer::Internal::AnyHash
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
sig do
|
|
139
|
+
returns(
|
|
140
|
+
T.nilable(Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek)
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
attr_reader :cmek
|
|
144
|
+
|
|
145
|
+
sig do
|
|
146
|
+
params(
|
|
147
|
+
cmek:
|
|
148
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek::OrHash
|
|
149
|
+
).void
|
|
150
|
+
end
|
|
151
|
+
attr_writer :cmek
|
|
152
|
+
|
|
153
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
154
|
+
# (CMEK).
|
|
155
|
+
sig do
|
|
156
|
+
params(
|
|
157
|
+
cmek:
|
|
158
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek::OrHash
|
|
159
|
+
).returns(T.attached_class)
|
|
160
|
+
end
|
|
161
|
+
def self.new(cmek: nil)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
sig do
|
|
165
|
+
override.returns(
|
|
166
|
+
{ cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek }
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
def to_hash
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
173
|
+
OrHash =
|
|
174
|
+
T.type_alias do
|
|
175
|
+
T.any(
|
|
176
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek,
|
|
177
|
+
Turbopuffer::Internal::AnyHash
|
|
178
|
+
)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# The name of the CMEK key in use.
|
|
182
|
+
sig { returns(String) }
|
|
183
|
+
attr_accessor :key_name
|
|
184
|
+
|
|
185
|
+
sig { params(key_name: String).returns(T.attached_class) }
|
|
186
|
+
def self.new(
|
|
187
|
+
# The name of the CMEK key in use.
|
|
188
|
+
key_name:
|
|
189
|
+
)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
sig { override.returns({ key_name: String }) }
|
|
193
|
+
def to_hash
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
sig do
|
|
199
|
+
override.returns(
|
|
200
|
+
T::Array[Turbopuffer::NamespaceMetadata::Encryption::Variants]
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
def self.variants
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
module Index
|
|
208
|
+
extend Turbopuffer::Internal::Type::Union
|
|
209
|
+
|
|
210
|
+
Variants =
|
|
211
|
+
T.type_alias do
|
|
212
|
+
T.any(
|
|
213
|
+
Turbopuffer::NamespaceMetadata::Index::Status,
|
|
214
|
+
Turbopuffer::NamespaceMetadata::Index::UnionMember1
|
|
215
|
+
)
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
class Status < Turbopuffer::Internal::Type::BaseModel
|
|
219
|
+
OrHash =
|
|
220
|
+
T.type_alias do
|
|
221
|
+
T.any(
|
|
222
|
+
Turbopuffer::NamespaceMetadata::Index::Status,
|
|
223
|
+
Turbopuffer::Internal::AnyHash
|
|
224
|
+
)
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
sig { returns(Symbol) }
|
|
228
|
+
attr_accessor :status
|
|
229
|
+
|
|
230
|
+
sig { params(status: Symbol).returns(T.attached_class) }
|
|
231
|
+
def self.new(status: :"up-to-date")
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
sig { override.returns({ status: Symbol }) }
|
|
235
|
+
def to_hash
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
class UnionMember1 < Turbopuffer::Internal::Type::BaseModel
|
|
240
|
+
OrHash =
|
|
241
|
+
T.type_alias do
|
|
242
|
+
T.any(
|
|
243
|
+
Turbopuffer::NamespaceMetadata::Index::UnionMember1,
|
|
244
|
+
Turbopuffer::Internal::AnyHash
|
|
245
|
+
)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
sig { returns(Symbol) }
|
|
249
|
+
attr_accessor :status
|
|
250
|
+
|
|
251
|
+
# The number of bytes in the namespace that are in the write-ahead log but have
|
|
252
|
+
# not yet been indexed.
|
|
253
|
+
sig { returns(Integer) }
|
|
254
|
+
attr_accessor :unindexed_bytes
|
|
255
|
+
|
|
256
|
+
sig do
|
|
257
|
+
params(unindexed_bytes: Integer, status: Symbol).returns(
|
|
258
|
+
T.attached_class
|
|
259
|
+
)
|
|
260
|
+
end
|
|
261
|
+
def self.new(
|
|
262
|
+
# The number of bytes in the namespace that are in the write-ahead log but have
|
|
263
|
+
# not yet been indexed.
|
|
264
|
+
unindexed_bytes:,
|
|
265
|
+
status: :updating
|
|
266
|
+
)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
sig { override.returns({ status: Symbol, unindexed_bytes: Integer }) }
|
|
270
|
+
def to_hash
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
sig do
|
|
275
|
+
override.returns(
|
|
276
|
+
T::Array[Turbopuffer::NamespaceMetadata::Index::Variants]
|
|
277
|
+
)
|
|
278
|
+
end
|
|
279
|
+
def self.variants
|
|
280
|
+
end
|
|
281
|
+
end
|
|
60
282
|
end
|
|
61
283
|
end
|
|
62
284
|
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
|
|
@@ -68,6 +75,20 @@ module Turbopuffer
|
|
|
68
75
|
end
|
|
69
76
|
attr_writer :encryption
|
|
70
77
|
|
|
78
|
+
# The patch and filter specifying which documents to patch.
|
|
79
|
+
sig do
|
|
80
|
+
returns(T.nilable(Turbopuffer::NamespaceWriteParams::PatchByFilter))
|
|
81
|
+
end
|
|
82
|
+
attr_reader :patch_by_filter
|
|
83
|
+
|
|
84
|
+
sig do
|
|
85
|
+
params(
|
|
86
|
+
patch_by_filter:
|
|
87
|
+
Turbopuffer::NamespaceWriteParams::PatchByFilter::OrHash
|
|
88
|
+
).void
|
|
89
|
+
end
|
|
90
|
+
attr_writer :patch_by_filter
|
|
91
|
+
|
|
71
92
|
# A list of documents in columnar format. Each key is a column name, mapped to an
|
|
72
93
|
# array of values for that column.
|
|
73
94
|
sig { returns(T.nilable(Turbopuffer::Columns)) }
|
|
@@ -140,8 +161,11 @@ module Turbopuffer
|
|
|
140
161
|
delete_by_filter: T.anything,
|
|
141
162
|
delete_condition: T.anything,
|
|
142
163
|
deletes: T::Array[Turbopuffer::ID::Variants],
|
|
164
|
+
disable_backpressure: T::Boolean,
|
|
143
165
|
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
|
144
166
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption::OrHash,
|
|
167
|
+
patch_by_filter:
|
|
168
|
+
Turbopuffer::NamespaceWriteParams::PatchByFilter::OrHash,
|
|
145
169
|
patch_columns: Turbopuffer::Columns::OrHash,
|
|
146
170
|
patch_condition: T.anything,
|
|
147
171
|
patch_rows: T::Array[Turbopuffer::Row::OrHash],
|
|
@@ -166,10 +190,14 @@ module Turbopuffer
|
|
|
166
190
|
# delete write. Only documents that pass the condition are deleted.
|
|
167
191
|
delete_condition: nil,
|
|
168
192
|
deletes: nil,
|
|
193
|
+
# Disables write throttling (HTTP 429 responses) during high-volume ingestion.
|
|
194
|
+
disable_backpressure: nil,
|
|
169
195
|
# A function used to calculate vector similarity.
|
|
170
196
|
distance_metric: nil,
|
|
171
197
|
# The encryption configuration for a namespace.
|
|
172
198
|
encryption: nil,
|
|
199
|
+
# The patch and filter specifying which documents to patch.
|
|
200
|
+
patch_by_filter: nil,
|
|
173
201
|
# A list of documents in columnar format. Each key is a column name, mapped to an
|
|
174
202
|
# array of values for that column.
|
|
175
203
|
patch_columns: nil,
|
|
@@ -198,8 +226,10 @@ module Turbopuffer
|
|
|
198
226
|
delete_by_filter: T.anything,
|
|
199
227
|
delete_condition: T.anything,
|
|
200
228
|
deletes: T::Array[Turbopuffer::ID::Variants],
|
|
229
|
+
disable_backpressure: T::Boolean,
|
|
201
230
|
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
|
202
231
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
|
232
|
+
patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
203
233
|
patch_columns: Turbopuffer::Columns,
|
|
204
234
|
patch_condition: T.anything,
|
|
205
235
|
patch_rows: T::Array[Turbopuffer::Row],
|
|
@@ -285,6 +315,45 @@ module Turbopuffer
|
|
|
285
315
|
end
|
|
286
316
|
end
|
|
287
317
|
end
|
|
318
|
+
|
|
319
|
+
class PatchByFilter < Turbopuffer::Internal::Type::BaseModel
|
|
320
|
+
OrHash =
|
|
321
|
+
T.type_alias do
|
|
322
|
+
T.any(
|
|
323
|
+
Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
324
|
+
Turbopuffer::Internal::AnyHash
|
|
325
|
+
)
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Filter by attributes. Same syntax as the query endpoint.
|
|
329
|
+
sig { returns(T.anything) }
|
|
330
|
+
attr_accessor :filters
|
|
331
|
+
|
|
332
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
333
|
+
attr_accessor :patch
|
|
334
|
+
|
|
335
|
+
# The patch and filter specifying which documents to patch.
|
|
336
|
+
sig do
|
|
337
|
+
params(
|
|
338
|
+
filters: T.anything,
|
|
339
|
+
patch: T::Hash[Symbol, T.anything]
|
|
340
|
+
).returns(T.attached_class)
|
|
341
|
+
end
|
|
342
|
+
def self.new(
|
|
343
|
+
# Filter by attributes. Same syntax as the query endpoint.
|
|
344
|
+
filters:,
|
|
345
|
+
patch:
|
|
346
|
+
)
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
sig do
|
|
350
|
+
override.returns(
|
|
351
|
+
{ filters: T.anything, patch: T::Hash[Symbol, T.anything] }
|
|
352
|
+
)
|
|
353
|
+
end
|
|
354
|
+
def to_hash
|
|
355
|
+
end
|
|
356
|
+
end
|
|
288
357
|
end
|
|
289
358
|
end
|
|
290
359
|
end
|
|
@@ -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,8 +240,11 @@ 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,
|
|
246
|
+
patch_by_filter:
|
|
247
|
+
Turbopuffer::NamespaceWriteParams::PatchByFilter::OrHash,
|
|
245
248
|
patch_columns: Turbopuffer::Columns::OrHash,
|
|
246
249
|
patch_condition: T.anything,
|
|
247
250
|
patch_rows: T::Array[Turbopuffer::Row::OrHash],
|
|
@@ -268,10 +271,15 @@ module Turbopuffer
|
|
|
268
271
|
delete_condition: nil,
|
|
269
272
|
# Body param:
|
|
270
273
|
deletes: nil,
|
|
274
|
+
# Body param: Disables write throttling (HTTP 429 responses) during high-volume
|
|
275
|
+
# ingestion.
|
|
276
|
+
disable_backpressure: nil,
|
|
271
277
|
# Body param: A function used to calculate vector similarity.
|
|
272
278
|
distance_metric: nil,
|
|
273
279
|
# Body param: The encryption configuration for a namespace.
|
|
274
280
|
encryption: nil,
|
|
281
|
+
# Body param: The patch and filter specifying which documents to patch.
|
|
282
|
+
patch_by_filter: nil,
|
|
275
283
|
# Body param: A list of documents in columnar format. Each key is a column name,
|
|
276
284
|
# mapped to an array of values for that column.
|
|
277
285
|
patch_columns: nil,
|
|
@@ -5,7 +5,10 @@ module Turbopuffer
|
|
|
5
5
|
approx_logical_bytes: Integer,
|
|
6
6
|
approx_row_count: Integer,
|
|
7
7
|
created_at: Time,
|
|
8
|
-
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
8
|
+
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
9
|
+
updated_at: Time,
|
|
10
|
+
encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
11
|
+
index: Turbopuffer::Models::NamespaceMetadata::index
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
class NamespaceMetadata < Turbopuffer::Internal::Type::BaseModel
|
|
@@ -17,19 +20,108 @@ module Turbopuffer
|
|
|
17
20
|
|
|
18
21
|
attr_accessor schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
19
22
|
|
|
23
|
+
attr_accessor updated_at: Time
|
|
24
|
+
|
|
25
|
+
attr_reader encryption: Turbopuffer::Models::NamespaceMetadata::encryption?
|
|
26
|
+
|
|
27
|
+
def encryption=: (
|
|
28
|
+
Turbopuffer::Models::NamespaceMetadata::encryption
|
|
29
|
+
) -> Turbopuffer::Models::NamespaceMetadata::encryption
|
|
30
|
+
|
|
31
|
+
attr_reader index: Turbopuffer::Models::NamespaceMetadata::index?
|
|
32
|
+
|
|
33
|
+
def index=: (
|
|
34
|
+
Turbopuffer::Models::NamespaceMetadata::index
|
|
35
|
+
) -> Turbopuffer::Models::NamespaceMetadata::index
|
|
36
|
+
|
|
20
37
|
def initialize: (
|
|
21
38
|
approx_logical_bytes: Integer,
|
|
22
39
|
approx_row_count: Integer,
|
|
23
40
|
created_at: Time,
|
|
24
|
-
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
41
|
+
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
42
|
+
updated_at: Time,
|
|
43
|
+
?encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
44
|
+
?index: Turbopuffer::Models::NamespaceMetadata::index
|
|
25
45
|
) -> void
|
|
26
46
|
|
|
27
47
|
def to_hash: -> {
|
|
28
48
|
approx_logical_bytes: Integer,
|
|
29
49
|
approx_row_count: Integer,
|
|
30
50
|
created_at: Time,
|
|
31
|
-
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
51
|
+
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
52
|
+
updated_at: Time,
|
|
53
|
+
encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
54
|
+
index: Turbopuffer::Models::NamespaceMetadata::index
|
|
32
55
|
}
|
|
56
|
+
|
|
57
|
+
type encryption = bool | Turbopuffer::NamespaceMetadata::Encryption::Cmek
|
|
58
|
+
|
|
59
|
+
module Encryption
|
|
60
|
+
extend Turbopuffer::Internal::Type::Union
|
|
61
|
+
|
|
62
|
+
type cmek =
|
|
63
|
+
{ cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek }
|
|
64
|
+
|
|
65
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
66
|
+
attr_reader cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek?
|
|
67
|
+
|
|
68
|
+
def cmek=: (
|
|
69
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
70
|
+
) -> Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
71
|
+
|
|
72
|
+
def initialize: (
|
|
73
|
+
?cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
74
|
+
) -> void
|
|
75
|
+
|
|
76
|
+
def to_hash: -> {
|
|
77
|
+
cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
type cmek = { key_name: String }
|
|
81
|
+
|
|
82
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
83
|
+
attr_accessor key_name: String
|
|
84
|
+
|
|
85
|
+
def initialize: (key_name: String) -> void
|
|
86
|
+
|
|
87
|
+
def to_hash: -> { key_name: String }
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def self?.variants: -> ::Array[Turbopuffer::Models::NamespaceMetadata::encryption]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
type index =
|
|
95
|
+
Turbopuffer::NamespaceMetadata::Index::Status
|
|
96
|
+
| Turbopuffer::NamespaceMetadata::Index::UnionMember1
|
|
97
|
+
|
|
98
|
+
module Index
|
|
99
|
+
extend Turbopuffer::Internal::Type::Union
|
|
100
|
+
|
|
101
|
+
type status = { status: :"up-to-date" }
|
|
102
|
+
|
|
103
|
+
class Status < Turbopuffer::Internal::Type::BaseModel
|
|
104
|
+
attr_accessor status: :"up-to-date"
|
|
105
|
+
|
|
106
|
+
def initialize: (?status: :"up-to-date") -> void
|
|
107
|
+
|
|
108
|
+
def to_hash: -> { status: :"up-to-date" }
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
type union_member1 = { status: :updating, unindexed_bytes: Integer }
|
|
112
|
+
|
|
113
|
+
class UnionMember1 < Turbopuffer::Internal::Type::BaseModel
|
|
114
|
+
attr_accessor status: :updating
|
|
115
|
+
|
|
116
|
+
attr_accessor unindexed_bytes: Integer
|
|
117
|
+
|
|
118
|
+
def initialize: (unindexed_bytes: Integer, ?status: :updating) -> void
|
|
119
|
+
|
|
120
|
+
def to_hash: -> { status: :updating, unindexed_bytes: Integer }
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def self?.variants: -> ::Array[Turbopuffer::Models::NamespaceMetadata::index]
|
|
124
|
+
end
|
|
33
125
|
end
|
|
34
126
|
end
|
|
35
127
|
end
|
|
@@ -7,8 +7,10 @@ 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,
|
|
13
|
+
patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
12
14
|
patch_columns: Turbopuffer::Columns,
|
|
13
15
|
patch_condition: top,
|
|
14
16
|
patch_rows: ::Array[Turbopuffer::Row],
|
|
@@ -45,6 +47,10 @@ module Turbopuffer
|
|
|
45
47
|
::Array[Turbopuffer::Models::id]
|
|
46
48
|
) -> ::Array[Turbopuffer::Models::id]
|
|
47
49
|
|
|
50
|
+
attr_reader disable_backpressure: bool?
|
|
51
|
+
|
|
52
|
+
def disable_backpressure=: (bool) -> bool
|
|
53
|
+
|
|
48
54
|
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
|
49
55
|
|
|
50
56
|
def distance_metric=: (
|
|
@@ -57,6 +63,12 @@ module Turbopuffer
|
|
|
57
63
|
Turbopuffer::NamespaceWriteParams::Encryption
|
|
58
64
|
) -> Turbopuffer::NamespaceWriteParams::Encryption
|
|
59
65
|
|
|
66
|
+
attr_reader patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter?
|
|
67
|
+
|
|
68
|
+
def patch_by_filter=: (
|
|
69
|
+
Turbopuffer::NamespaceWriteParams::PatchByFilter
|
|
70
|
+
) -> Turbopuffer::NamespaceWriteParams::PatchByFilter
|
|
71
|
+
|
|
60
72
|
attr_reader patch_columns: Turbopuffer::Columns?
|
|
61
73
|
|
|
62
74
|
def patch_columns=: (Turbopuffer::Columns) -> Turbopuffer::Columns
|
|
@@ -93,8 +105,10 @@ module Turbopuffer
|
|
|
93
105
|
?delete_by_filter: top,
|
|
94
106
|
?delete_condition: top,
|
|
95
107
|
?deletes: ::Array[Turbopuffer::Models::id],
|
|
108
|
+
?disable_backpressure: bool,
|
|
96
109
|
?distance_metric: Turbopuffer::Models::distance_metric,
|
|
97
110
|
?encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
|
111
|
+
?patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
98
112
|
?patch_columns: Turbopuffer::Columns,
|
|
99
113
|
?patch_condition: top,
|
|
100
114
|
?patch_rows: ::Array[Turbopuffer::Row],
|
|
@@ -111,8 +125,10 @@ module Turbopuffer
|
|
|
111
125
|
delete_by_filter: top,
|
|
112
126
|
delete_condition: top,
|
|
113
127
|
deletes: ::Array[Turbopuffer::Models::id],
|
|
128
|
+
disable_backpressure: bool,
|
|
114
129
|
distance_metric: Turbopuffer::Models::distance_metric,
|
|
115
130
|
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
|
131
|
+
patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
116
132
|
patch_columns: Turbopuffer::Columns,
|
|
117
133
|
patch_condition: top,
|
|
118
134
|
patch_rows: ::Array[Turbopuffer::Row],
|
|
@@ -151,6 +167,18 @@ module Turbopuffer
|
|
|
151
167
|
def to_hash: -> { key_name: String }
|
|
152
168
|
end
|
|
153
169
|
end
|
|
170
|
+
|
|
171
|
+
type patch_by_filter = { filters: top, patch: ::Hash[Symbol, top] }
|
|
172
|
+
|
|
173
|
+
class PatchByFilter < Turbopuffer::Internal::Type::BaseModel
|
|
174
|
+
attr_accessor filters: top
|
|
175
|
+
|
|
176
|
+
attr_accessor patch: ::Hash[Symbol, top]
|
|
177
|
+
|
|
178
|
+
def initialize: (filters: top, patch: ::Hash[Symbol, top]) -> void
|
|
179
|
+
|
|
180
|
+
def to_hash: -> { filters: top, patch: ::Hash[Symbol, top] }
|
|
181
|
+
end
|
|
154
182
|
end
|
|
155
183
|
end
|
|
156
184
|
end
|
|
@@ -81,8 +81,10 @@ 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,
|
|
87
|
+
?patch_by_filter: Turbopuffer::NamespaceWriteParams::PatchByFilter,
|
|
86
88
|
?patch_columns: Turbopuffer::Columns,
|
|
87
89
|
?patch_condition: top,
|
|
88
90
|
?patch_rows: ::Array[Turbopuffer::Row],
|
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.5.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-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|