turbopuffer 1.5.0 → 1.6.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 +23 -0
- data/README.md +1 -1
- data/lib/turbopuffer/internal/transport/base_client.rb +7 -1
- data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +36 -26
- data/lib/turbopuffer/internal/type/union.rb +1 -1
- data/lib/turbopuffer/models/attribute_schema_config.rb +44 -14
- data/lib/turbopuffer/models/namespace_metadata.rb +39 -28
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +1 -0
- data/manifest.yaml +1 -0
- data/rbi/turbopuffer/internal/transport/base_client.rbi +5 -0
- data/rbi/turbopuffer/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/turbopuffer/internal/type/base_model.rbi +8 -4
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +109 -24
- data/rbi/turbopuffer/models/namespace_metadata.rbi +59 -59
- data/sig/turbopuffer/internal/transport/base_client.rbs +2 -0
- data/sig/turbopuffer/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/turbopuffer/models/attribute_schema_config.rbs +42 -15
- data/sig/turbopuffer/models/namespace_metadata.rbs +34 -34
- 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: 07fda2e1e9249b4c16e37504d02f6b65e5cff40d0d8b448b9d58c1ad7432391a
|
|
4
|
+
data.tar.gz: 73ee6163f398dff241b51040941899ee65027ded8bff6ef8ee474e63e8d0cf13
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7019c102f0665d6912974007b9ed3d3837e19f210596b4386faeacb028a62c594c60ce39791568721f7873ae56c30062cc28c360efe7be94204db4683d589229
|
|
7
|
+
data.tar.gz: 34ca700c304917dd2e096c660a2db731394dd364bc879d5d76fc2d60ca22e552f568be0dfb5eb9b4f5206035edd580d1c4330fe8fcfa1ae89e7846bc72b1a6fb
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.0 (2025-11-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.5.0...v1.6.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.5.0...v1.6.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Add vector attribute schema to metadata endpoint ([a509e47](https://github.com/turbopuffer/turbopuffer-ruby/commit/a509e479bc8fdeb6a72b39703636d1ccc331274e))
|
|
10
|
+
* handle thread interrupts in the core HTTP client ([ad531ac](https://github.com/turbopuffer/turbopuffer-ruby/commit/ad531ac4776d6445a23033601d7e46900f8824bc))
|
|
11
|
+
* Make `type` required on `AttributeSchemaConfig` ([c9300f6](https://github.com/turbopuffer/turbopuffer-ruby/commit/c9300f621999c6937d16c363ba7bdb423605a825))
|
|
12
|
+
* openapi: Fix stainless warnings ([1b7685f](https://github.com/turbopuffer/turbopuffer-ruby/commit/1b7685f30fd448eff4d17b809714ee01aa864ffd))
|
|
13
|
+
* openapi: name variants of `NamespaceMetadata.index` ([3b7cd24](https://github.com/turbopuffer/turbopuffer-ruby/commit/3b7cd24aa4f0fbb0c7f805d28f3c0e20726697de))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* better thread safety via early initializing SSL store during HTTP client creation ([588faf7](https://github.com/turbopuffer/turbopuffer-ruby/commit/588faf74de4e21652afadd3eb557062818639cd6))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Chores
|
|
22
|
+
|
|
23
|
+
* bump dependency version and update sorbet types ([b8c6c9a](https://github.com/turbopuffer/turbopuffer-ruby/commit/b8c6c9a56cf98142d6736e21b25fa3a541fafd47))
|
|
24
|
+
* **client:** send user-agent header ([dda4633](https://github.com/turbopuffer/turbopuffer-ruby/commit/dda4633d4fe3cfb16b90d5d4b32aa887ee810d52))
|
|
25
|
+
|
|
3
26
|
## 1.5.0 (2025-10-21)
|
|
4
27
|
|
|
5
28
|
Full Changelog: [v1.4.0...v1.5.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.4.0...v1.5.0)
|
data/README.md
CHANGED
|
@@ -201,7 +201,8 @@ module Turbopuffer
|
|
|
201
201
|
self.class::PLATFORM_HEADERS,
|
|
202
202
|
{
|
|
203
203
|
"accept" => "application/json",
|
|
204
|
-
"content-type" => "application/json"
|
|
204
|
+
"content-type" => "application/json",
|
|
205
|
+
"user-agent" => user_agent
|
|
205
206
|
},
|
|
206
207
|
headers
|
|
207
208
|
)
|
|
@@ -219,6 +220,11 @@ module Turbopuffer
|
|
|
219
220
|
# @return [Hash{String=>String}]
|
|
220
221
|
private def auth_headers = {}
|
|
221
222
|
|
|
223
|
+
# @api private
|
|
224
|
+
#
|
|
225
|
+
# @return [String]
|
|
226
|
+
private def user_agent = "#{self.class.name}/Ruby #{Turbopuffer::VERSION}"
|
|
227
|
+
|
|
222
228
|
# @api private
|
|
223
229
|
#
|
|
224
230
|
# @return [String]
|
|
@@ -16,10 +16,11 @@ module Turbopuffer
|
|
|
16
16
|
class << self
|
|
17
17
|
# @api private
|
|
18
18
|
#
|
|
19
|
+
# @param cert_store [OpenSSL::X509::Store]
|
|
19
20
|
# @param url [URI::Generic]
|
|
20
21
|
#
|
|
21
22
|
# @return [Net::HTTP]
|
|
22
|
-
def connect(url)
|
|
23
|
+
def connect(cert_store:, url:)
|
|
23
24
|
port =
|
|
24
25
|
case [url.port, url.scheme]
|
|
25
26
|
in [Integer, _]
|
|
@@ -33,6 +34,8 @@ module Turbopuffer
|
|
|
33
34
|
Net::HTTP.new(url.host, port).tap do
|
|
34
35
|
_1.use_ssl = %w[https wss].include?(url.scheme)
|
|
35
36
|
_1.max_retries = 0
|
|
37
|
+
|
|
38
|
+
(_1.cert_store = cert_store) if _1.use_ssl?
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -102,7 +105,7 @@ module Turbopuffer
|
|
|
102
105
|
pool =
|
|
103
106
|
@mutex.synchronize do
|
|
104
107
|
@pools[origin] ||= ConnectionPool.new(size: @size) do
|
|
105
|
-
self.class.connect(url)
|
|
108
|
+
self.class.connect(cert_store: @cert_store, url: url)
|
|
106
109
|
end
|
|
107
110
|
end
|
|
108
111
|
|
|
@@ -128,40 +131,48 @@ module Turbopuffer
|
|
|
128
131
|
url, deadline = request.fetch_values(:url, :deadline)
|
|
129
132
|
|
|
130
133
|
req = nil
|
|
131
|
-
eof = false
|
|
132
134
|
finished = false
|
|
133
|
-
closing = nil
|
|
134
135
|
|
|
135
136
|
# rubocop:disable Metrics/BlockLength
|
|
136
137
|
enum = Enumerator.new do |y|
|
|
137
138
|
next if finished
|
|
138
139
|
|
|
139
140
|
with_pool(url, deadline: deadline) do |conn|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
conn.start
|
|
148
|
-
end
|
|
141
|
+
eof = false
|
|
142
|
+
closing = nil
|
|
143
|
+
::Thread.handle_interrupt(Object => :never) do
|
|
144
|
+
::Thread.handle_interrupt(Object => :immediate) do
|
|
145
|
+
req, closing = self.class.build_request(request) do
|
|
146
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
147
|
+
end
|
|
149
148
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
rsp.read_body do |bytes|
|
|
156
|
-
y << bytes.force_encoding(Encoding::BINARY)
|
|
157
|
-
break if finished
|
|
149
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
150
|
+
unless conn.started?
|
|
151
|
+
conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
|
|
152
|
+
conn.start
|
|
153
|
+
end
|
|
158
154
|
|
|
159
155
|
self.class.calibrate_socket_timeout(conn, deadline)
|
|
156
|
+
conn.request(req) do |rsp|
|
|
157
|
+
y << [req, rsp]
|
|
158
|
+
break if finished
|
|
159
|
+
|
|
160
|
+
rsp.read_body do |bytes|
|
|
161
|
+
y << bytes.force_encoding(Encoding::BINARY)
|
|
162
|
+
break if finished
|
|
163
|
+
|
|
164
|
+
self.class.calibrate_socket_timeout(conn, deadline)
|
|
165
|
+
end
|
|
166
|
+
eof = true
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
ensure
|
|
170
|
+
begin
|
|
171
|
+
conn.finish if !eof && conn&.started?
|
|
172
|
+
ensure
|
|
173
|
+
closing&.call
|
|
160
174
|
end
|
|
161
|
-
eof = true
|
|
162
175
|
end
|
|
163
|
-
ensure
|
|
164
|
-
conn.finish if !eof && conn&.started?
|
|
165
176
|
end
|
|
166
177
|
rescue Timeout::Error
|
|
167
178
|
raise Turbopuffer::Errors::APITimeoutError.new(url: url, request: req)
|
|
@@ -174,8 +185,6 @@ module Turbopuffer
|
|
|
174
185
|
body = Turbopuffer::Internal::Util.fused_enum(enum, external: true) do
|
|
175
186
|
finished = true
|
|
176
187
|
loop { enum.next }
|
|
177
|
-
ensure
|
|
178
|
-
closing&.call
|
|
179
188
|
end
|
|
180
189
|
[Integer(response.code), response, body]
|
|
181
190
|
end
|
|
@@ -186,6 +195,7 @@ module Turbopuffer
|
|
|
186
195
|
def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS)
|
|
187
196
|
@mutex = Mutex.new
|
|
188
197
|
@size = size
|
|
198
|
+
@cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths)
|
|
189
199
|
@pools = {}
|
|
190
200
|
end
|
|
191
201
|
|
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
module Turbopuffer
|
|
4
4
|
module Models
|
|
5
5
|
class AttributeSchemaConfig < Turbopuffer::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute type
|
|
7
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
|
8
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
|
9
|
+
# [DIMS]f16, [DIMS]f32.
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :type, String
|
|
13
|
+
|
|
6
14
|
# @!attribute ann
|
|
7
|
-
# Whether to create an approximate nearest neighbor index for the attribute.
|
|
15
|
+
# Whether to create an approximate nearest neighbor index for the attribute. Can
|
|
16
|
+
# be a boolean or a detailed configuration object.
|
|
8
17
|
#
|
|
9
|
-
# @return [Boolean, nil]
|
|
10
|
-
optional :ann, Turbopuffer::
|
|
18
|
+
# @return [Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig, nil]
|
|
19
|
+
optional :ann, union: -> { Turbopuffer::AttributeSchemaConfig::Ann }
|
|
11
20
|
|
|
12
21
|
# @!attribute filterable
|
|
13
22
|
# Whether or not the attributes can be used in filters.
|
|
@@ -29,29 +38,50 @@ module Turbopuffer
|
|
|
29
38
|
# @return [Boolean, nil]
|
|
30
39
|
optional :regex, Turbopuffer::Internal::Type::Boolean
|
|
31
40
|
|
|
32
|
-
# @!
|
|
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.
|
|
36
|
-
#
|
|
37
|
-
# @return [String, nil]
|
|
38
|
-
optional :type, String
|
|
39
|
-
|
|
40
|
-
# @!method initialize(ann: nil, filterable: nil, full_text_search: nil, regex: nil, type: nil)
|
|
41
|
+
# @!method initialize(type:, ann: nil, filterable: nil, full_text_search: nil, regex: nil)
|
|
41
42
|
# Some parameter documentations has been truncated, see
|
|
42
43
|
# {Turbopuffer::Models::AttributeSchemaConfig} for more details.
|
|
43
44
|
#
|
|
44
45
|
# Detailed configuration for an attribute attached to a document.
|
|
45
46
|
#
|
|
46
|
-
# @param
|
|
47
|
+
# @param type [String] The data type of the attribute. Valid values: string, int, uint, float, uuid, da
|
|
48
|
+
#
|
|
49
|
+
# @param ann [Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig] Whether to create an approximate nearest neighbor index for the attribute. Can b
|
|
47
50
|
#
|
|
48
51
|
# @param filterable [Boolean] Whether or not the attributes can be used in filters.
|
|
49
52
|
#
|
|
50
53
|
# @param full_text_search [Boolean, Turbopuffer::Models::FullTextSearchConfig] Whether this attribute can be used as part of a BM25 full-text search. Requires
|
|
51
54
|
#
|
|
52
55
|
# @param regex [Boolean] Whether to enable Regex filters on this attribute.
|
|
56
|
+
|
|
57
|
+
# Whether to create an approximate nearest neighbor index for the attribute. Can
|
|
58
|
+
# be a boolean or a detailed configuration object.
|
|
53
59
|
#
|
|
54
|
-
#
|
|
60
|
+
# @see Turbopuffer::Models::AttributeSchemaConfig#ann
|
|
61
|
+
module Ann
|
|
62
|
+
extend Turbopuffer::Internal::Type::Union
|
|
63
|
+
|
|
64
|
+
variant Turbopuffer::Internal::Type::Boolean
|
|
65
|
+
|
|
66
|
+
# Configuration options for ANN (Approximate Nearest Neighbor) indexing.
|
|
67
|
+
variant -> { Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig }
|
|
68
|
+
|
|
69
|
+
class AnnConfig < Turbopuffer::Internal::Type::BaseModel
|
|
70
|
+
# @!attribute distance_metric
|
|
71
|
+
# A function used to calculate vector similarity.
|
|
72
|
+
#
|
|
73
|
+
# @return [Symbol, Turbopuffer::Models::DistanceMetric, nil]
|
|
74
|
+
optional :distance_metric, enum: -> { Turbopuffer::DistanceMetric }
|
|
75
|
+
|
|
76
|
+
# @!method initialize(distance_metric: nil)
|
|
77
|
+
# Configuration options for ANN (Approximate Nearest Neighbor) indexing.
|
|
78
|
+
#
|
|
79
|
+
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# @!method self.variants
|
|
83
|
+
# @return [Array(Boolean, Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig)]
|
|
84
|
+
end
|
|
55
85
|
end
|
|
56
86
|
end
|
|
57
87
|
end
|
|
@@ -22,6 +22,18 @@ module Turbopuffer
|
|
|
22
22
|
# @return [Time]
|
|
23
23
|
required :created_at, Time
|
|
24
24
|
|
|
25
|
+
# @!attribute encryption
|
|
26
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
27
|
+
# (CMEK).
|
|
28
|
+
#
|
|
29
|
+
# @return [Turbopuffer::Models::NamespaceMetadata::Encryption::Sse, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek]
|
|
30
|
+
required :encryption, union: -> { Turbopuffer::NamespaceMetadata::Encryption }
|
|
31
|
+
|
|
32
|
+
# @!attribute index
|
|
33
|
+
#
|
|
34
|
+
# @return [Turbopuffer::Models::NamespaceMetadata::Index::IndexUpToDate, Turbopuffer::Models::NamespaceMetadata::Index::IndexUpdating]
|
|
35
|
+
required :index, union: -> { Turbopuffer::NamespaceMetadata::Index }
|
|
36
|
+
|
|
25
37
|
# @!attribute schema
|
|
26
38
|
# The schema of the namespace.
|
|
27
39
|
#
|
|
@@ -34,19 +46,7 @@ module Turbopuffer
|
|
|
34
46
|
# @return [Time]
|
|
35
47
|
required :updated_at, Time
|
|
36
48
|
|
|
37
|
-
# @!
|
|
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)
|
|
49
|
+
# @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, encryption:, index:, schema:, updated_at:)
|
|
50
50
|
# Some parameter documentations has been truncated, see
|
|
51
51
|
# {Turbopuffer::Models::NamespaceMetadata} for more details.
|
|
52
52
|
#
|
|
@@ -58,13 +58,13 @@ module Turbopuffer
|
|
|
58
58
|
#
|
|
59
59
|
# @param created_at [Time] The timestamp when the namespace was created.
|
|
60
60
|
#
|
|
61
|
-
# @param
|
|
61
|
+
# @param encryption [Turbopuffer::Models::NamespaceMetadata::Encryption::Sse, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek] Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
62
62
|
#
|
|
63
|
-
# @param
|
|
63
|
+
# @param index [Turbopuffer::Models::NamespaceMetadata::Index::IndexUpToDate, Turbopuffer::Models::NamespaceMetadata::Index::IndexUpdating]
|
|
64
64
|
#
|
|
65
|
-
# @param
|
|
65
|
+
# @param schema [Hash{Symbol=>Turbopuffer::Models::AttributeSchemaConfig}] The schema of the namespace.
|
|
66
66
|
#
|
|
67
|
-
# @param
|
|
67
|
+
# @param updated_at [Time] The timestamp when the namespace was last modified by a write operation.
|
|
68
68
|
|
|
69
69
|
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
70
70
|
# (CMEK).
|
|
@@ -73,18 +73,29 @@ module Turbopuffer
|
|
|
73
73
|
module Encryption
|
|
74
74
|
extend Turbopuffer::Internal::Type::Union
|
|
75
75
|
|
|
76
|
-
variant Turbopuffer::
|
|
76
|
+
variant -> { Turbopuffer::NamespaceMetadata::Encryption::Sse }
|
|
77
77
|
|
|
78
78
|
# Indicates that the namespace is encrypted with a customer-managed encryption key (CMEK).
|
|
79
79
|
variant -> { Turbopuffer::NamespaceMetadata::Encryption::Cmek }
|
|
80
80
|
|
|
81
|
+
class Sse < Turbopuffer::Internal::Type::BaseModel
|
|
82
|
+
# @!attribute sse
|
|
83
|
+
# Always true. Indicates that the namespace is encrypted with SSE.
|
|
84
|
+
#
|
|
85
|
+
# @return [Boolean]
|
|
86
|
+
required :sse, Turbopuffer::Internal::Type::Boolean
|
|
87
|
+
|
|
88
|
+
# @!method initialize(sse:)
|
|
89
|
+
# @param sse [Boolean] Always true. Indicates that the namespace is encrypted with SSE.
|
|
90
|
+
end
|
|
91
|
+
|
|
81
92
|
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
82
93
|
# @!attribute cmek
|
|
83
94
|
#
|
|
84
|
-
# @return [Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
85
|
-
|
|
95
|
+
# @return [Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek::Cmek]
|
|
96
|
+
required :cmek, -> { Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek }
|
|
86
97
|
|
|
87
|
-
# @!method initialize(cmek:
|
|
98
|
+
# @!method initialize(cmek:)
|
|
88
99
|
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
89
100
|
# (CMEK).
|
|
90
101
|
#
|
|
@@ -104,18 +115,18 @@ module Turbopuffer
|
|
|
104
115
|
end
|
|
105
116
|
|
|
106
117
|
# @!method self.variants
|
|
107
|
-
# @return [Array(
|
|
118
|
+
# @return [Array(Turbopuffer::Models::NamespaceMetadata::Encryption::Sse, Turbopuffer::Models::NamespaceMetadata::Encryption::Cmek)]
|
|
108
119
|
end
|
|
109
120
|
|
|
110
121
|
# @see Turbopuffer::Models::NamespaceMetadata#index
|
|
111
122
|
module Index
|
|
112
123
|
extend Turbopuffer::Internal::Type::Union
|
|
113
124
|
|
|
114
|
-
variant -> { Turbopuffer::NamespaceMetadata::Index::
|
|
125
|
+
variant -> { Turbopuffer::NamespaceMetadata::Index::IndexUpToDate }
|
|
115
126
|
|
|
116
|
-
variant -> { Turbopuffer::NamespaceMetadata::Index::
|
|
127
|
+
variant -> { Turbopuffer::NamespaceMetadata::Index::IndexUpdating }
|
|
117
128
|
|
|
118
|
-
class
|
|
129
|
+
class IndexUpToDate < Turbopuffer::Internal::Type::BaseModel
|
|
119
130
|
# @!attribute status
|
|
120
131
|
#
|
|
121
132
|
# @return [Symbol, :"up-to-date"]
|
|
@@ -125,7 +136,7 @@ module Turbopuffer
|
|
|
125
136
|
# @param status [Symbol, :"up-to-date"]
|
|
126
137
|
end
|
|
127
138
|
|
|
128
|
-
class
|
|
139
|
+
class IndexUpdating < Turbopuffer::Internal::Type::BaseModel
|
|
129
140
|
# @!attribute status
|
|
130
141
|
#
|
|
131
142
|
# @return [Symbol, :updating]
|
|
@@ -140,7 +151,7 @@ module Turbopuffer
|
|
|
140
151
|
|
|
141
152
|
# @!method initialize(unindexed_bytes:, status: :updating)
|
|
142
153
|
# Some parameter documentations has been truncated, see
|
|
143
|
-
# {Turbopuffer::Models::NamespaceMetadata::Index::
|
|
154
|
+
# {Turbopuffer::Models::NamespaceMetadata::Index::IndexUpdating} for more details.
|
|
144
155
|
#
|
|
145
156
|
# @param unindexed_bytes [Integer] The number of bytes in the namespace that are in the write-ahead log but have no
|
|
146
157
|
#
|
|
@@ -148,7 +159,7 @@ module Turbopuffer
|
|
|
148
159
|
end
|
|
149
160
|
|
|
150
161
|
# @!method self.variants
|
|
151
|
-
# @return [Array(Turbopuffer::Models::NamespaceMetadata::Index::
|
|
162
|
+
# @return [Array(Turbopuffer::Models::NamespaceMetadata::Index::IndexUpToDate, Turbopuffer::Models::NamespaceMetadata::Index::IndexUpdating)]
|
|
152
163
|
end
|
|
153
164
|
end
|
|
154
165
|
end
|
data/lib/turbopuffer/version.rb
CHANGED
data/lib/turbopuffer.rb
CHANGED
data/manifest.yaml
CHANGED
|
@@ -26,8 +26,12 @@ module Turbopuffer
|
|
|
26
26
|
|
|
27
27
|
class << self
|
|
28
28
|
# @api private
|
|
29
|
-
sig
|
|
30
|
-
|
|
29
|
+
sig do
|
|
30
|
+
params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns(
|
|
31
|
+
Net::HTTP
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def connect(cert_store:, url:)
|
|
31
35
|
end
|
|
32
36
|
|
|
33
37
|
# @api private
|
|
@@ -31,7 +31,7 @@ module Turbopuffer
|
|
|
31
31
|
#
|
|
32
32
|
# Assumes superclass fields are totally defined before fields are accessed /
|
|
33
33
|
# defined on subclasses.
|
|
34
|
-
sig { params(child:
|
|
34
|
+
sig { params(child: Turbopuffer::Internal::Type::BaseModel).void }
|
|
35
35
|
def inherited(child)
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -276,9 +276,13 @@ module Turbopuffer
|
|
|
276
276
|
|
|
277
277
|
# Create a new instance of a model.
|
|
278
278
|
sig do
|
|
279
|
-
params(
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
params(
|
|
280
|
+
data:
|
|
281
|
+
T.any(
|
|
282
|
+
T::Hash[Symbol, T.anything],
|
|
283
|
+
Turbopuffer::Internal::Type::BaseModel
|
|
284
|
+
)
|
|
285
|
+
).returns(T.attached_class)
|
|
282
286
|
end
|
|
283
287
|
def self.new(data = {})
|
|
284
288
|
end
|
|
@@ -11,11 +11,35 @@ module Turbopuffer
|
|
|
11
11
|
)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
#
|
|
15
|
-
|
|
14
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
|
15
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
|
16
|
+
# [DIMS]f16, [DIMS]f32.
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
# Whether to create an approximate nearest neighbor index for the attribute. Can
|
|
21
|
+
# be a boolean or a detailed configuration object.
|
|
22
|
+
sig do
|
|
23
|
+
returns(
|
|
24
|
+
T.nilable(
|
|
25
|
+
T.any(
|
|
26
|
+
T::Boolean,
|
|
27
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
end
|
|
16
32
|
attr_reader :ann
|
|
17
33
|
|
|
18
|
-
sig
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
ann:
|
|
37
|
+
T.any(
|
|
38
|
+
T::Boolean,
|
|
39
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig::OrHash
|
|
40
|
+
)
|
|
41
|
+
).void
|
|
42
|
+
end
|
|
19
43
|
attr_writer :ann
|
|
20
44
|
|
|
21
45
|
# Whether or not the attributes can be used in filters.
|
|
@@ -48,28 +72,28 @@ module Turbopuffer
|
|
|
48
72
|
sig { params(regex: T::Boolean).void }
|
|
49
73
|
attr_writer :regex
|
|
50
74
|
|
|
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.
|
|
54
|
-
sig { returns(T.nilable(String)) }
|
|
55
|
-
attr_reader :type
|
|
56
|
-
|
|
57
|
-
sig { params(type: String).void }
|
|
58
|
-
attr_writer :type
|
|
59
|
-
|
|
60
75
|
# Detailed configuration for an attribute attached to a document.
|
|
61
76
|
sig do
|
|
62
77
|
params(
|
|
63
|
-
|
|
78
|
+
type: String,
|
|
79
|
+
ann:
|
|
80
|
+
T.any(
|
|
81
|
+
T::Boolean,
|
|
82
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig::OrHash
|
|
83
|
+
),
|
|
64
84
|
filterable: T::Boolean,
|
|
65
85
|
full_text_search:
|
|
66
86
|
T.any(T::Boolean, Turbopuffer::FullTextSearchConfig::OrHash),
|
|
67
|
-
regex: T::Boolean
|
|
68
|
-
type: String
|
|
87
|
+
regex: T::Boolean
|
|
69
88
|
).returns(T.attached_class)
|
|
70
89
|
end
|
|
71
90
|
def self.new(
|
|
72
|
-
#
|
|
91
|
+
# The data type of the attribute. Valid values: string, int, uint, float, uuid,
|
|
92
|
+
# datetime, bool, []string, []int, []uint, []float, []uuid, []datetime, []bool,
|
|
93
|
+
# [DIMS]f16, [DIMS]f32.
|
|
94
|
+
type:,
|
|
95
|
+
# Whether to create an approximate nearest neighbor index for the attribute. Can
|
|
96
|
+
# be a boolean or a detailed configuration object.
|
|
73
97
|
ann: nil,
|
|
74
98
|
# Whether or not the attributes can be used in filters.
|
|
75
99
|
filterable: nil,
|
|
@@ -78,28 +102,89 @@ module Turbopuffer
|
|
|
78
102
|
# filterable. You can override this by setting `filterable: true`.
|
|
79
103
|
full_text_search: nil,
|
|
80
104
|
# Whether to enable Regex filters on this attribute.
|
|
81
|
-
regex: nil
|
|
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.
|
|
85
|
-
type: nil
|
|
105
|
+
regex: nil
|
|
86
106
|
)
|
|
87
107
|
end
|
|
88
108
|
|
|
89
109
|
sig do
|
|
90
110
|
override.returns(
|
|
91
111
|
{
|
|
92
|
-
|
|
112
|
+
type: String,
|
|
113
|
+
ann:
|
|
114
|
+
T.any(
|
|
115
|
+
T::Boolean,
|
|
116
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig
|
|
117
|
+
),
|
|
93
118
|
filterable: T::Boolean,
|
|
94
119
|
full_text_search:
|
|
95
120
|
T.any(T::Boolean, Turbopuffer::FullTextSearchConfig),
|
|
96
|
-
regex: T::Boolean
|
|
97
|
-
type: String
|
|
121
|
+
regex: T::Boolean
|
|
98
122
|
}
|
|
99
123
|
)
|
|
100
124
|
end
|
|
101
125
|
def to_hash
|
|
102
126
|
end
|
|
127
|
+
|
|
128
|
+
# Whether to create an approximate nearest neighbor index for the attribute. Can
|
|
129
|
+
# be a boolean or a detailed configuration object.
|
|
130
|
+
module Ann
|
|
131
|
+
extend Turbopuffer::Internal::Type::Union
|
|
132
|
+
|
|
133
|
+
Variants =
|
|
134
|
+
T.type_alias do
|
|
135
|
+
T.any(
|
|
136
|
+
T::Boolean,
|
|
137
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
class AnnConfig < Turbopuffer::Internal::Type::BaseModel
|
|
142
|
+
OrHash =
|
|
143
|
+
T.type_alias do
|
|
144
|
+
T.any(
|
|
145
|
+
Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig,
|
|
146
|
+
Turbopuffer::Internal::AnyHash
|
|
147
|
+
)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# A function used to calculate vector similarity.
|
|
151
|
+
sig { returns(T.nilable(Turbopuffer::DistanceMetric::OrSymbol)) }
|
|
152
|
+
attr_reader :distance_metric
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
params(distance_metric: Turbopuffer::DistanceMetric::OrSymbol).void
|
|
156
|
+
end
|
|
157
|
+
attr_writer :distance_metric
|
|
158
|
+
|
|
159
|
+
# Configuration options for ANN (Approximate Nearest Neighbor) indexing.
|
|
160
|
+
sig do
|
|
161
|
+
params(
|
|
162
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol
|
|
163
|
+
).returns(T.attached_class)
|
|
164
|
+
end
|
|
165
|
+
def self.new(
|
|
166
|
+
# A function used to calculate vector similarity.
|
|
167
|
+
distance_metric: nil
|
|
168
|
+
)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
sig do
|
|
172
|
+
override.returns(
|
|
173
|
+
{ distance_metric: Turbopuffer::DistanceMetric::OrSymbol }
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def to_hash
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
sig do
|
|
181
|
+
override.returns(
|
|
182
|
+
T::Array[Turbopuffer::AttributeSchemaConfig::Ann::Variants]
|
|
183
|
+
)
|
|
184
|
+
end
|
|
185
|
+
def self.variants
|
|
186
|
+
end
|
|
187
|
+
end
|
|
103
188
|
end
|
|
104
189
|
end
|
|
105
190
|
end
|
|
@@ -20,6 +20,14 @@ module Turbopuffer
|
|
|
20
20
|
sig { returns(Time) }
|
|
21
21
|
attr_accessor :created_at
|
|
22
22
|
|
|
23
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
24
|
+
# (CMEK).
|
|
25
|
+
sig { returns(Turbopuffer::NamespaceMetadata::Encryption::Variants) }
|
|
26
|
+
attr_accessor :encryption
|
|
27
|
+
|
|
28
|
+
sig { returns(Turbopuffer::NamespaceMetadata::Index::Variants) }
|
|
29
|
+
attr_accessor :index
|
|
30
|
+
|
|
23
31
|
# The schema of the namespace.
|
|
24
32
|
sig { returns(T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]) }
|
|
25
33
|
attr_accessor :schema
|
|
@@ -28,58 +36,24 @@ module Turbopuffer
|
|
|
28
36
|
sig { returns(Time) }
|
|
29
37
|
attr_accessor :updated_at
|
|
30
38
|
|
|
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
|
-
|
|
65
39
|
# Metadata about a namespace.
|
|
66
40
|
sig do
|
|
67
41
|
params(
|
|
68
42
|
approx_logical_bytes: Integer,
|
|
69
43
|
approx_row_count: Integer,
|
|
70
44
|
created_at: Time,
|
|
71
|
-
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig::OrHash],
|
|
72
|
-
updated_at: Time,
|
|
73
45
|
encryption:
|
|
74
46
|
T.any(
|
|
75
|
-
|
|
47
|
+
Turbopuffer::NamespaceMetadata::Encryption::Sse::OrHash,
|
|
76
48
|
Turbopuffer::NamespaceMetadata::Encryption::Cmek::OrHash
|
|
77
49
|
),
|
|
78
50
|
index:
|
|
79
51
|
T.any(
|
|
80
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
81
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
82
|
-
)
|
|
52
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpToDate::OrHash,
|
|
53
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpdating::OrHash
|
|
54
|
+
),
|
|
55
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig::OrHash],
|
|
56
|
+
updated_at: Time
|
|
83
57
|
).returns(T.attached_class)
|
|
84
58
|
end
|
|
85
59
|
def self.new(
|
|
@@ -89,14 +63,14 @@ module Turbopuffer
|
|
|
89
63
|
approx_row_count:,
|
|
90
64
|
# The timestamp when the namespace was created.
|
|
91
65
|
created_at:,
|
|
66
|
+
# Indicates that the namespace is encrypted with a customer-managed encryption key
|
|
67
|
+
# (CMEK).
|
|
68
|
+
encryption:,
|
|
69
|
+
index:,
|
|
92
70
|
# The schema of the namespace.
|
|
93
71
|
schema:,
|
|
94
72
|
# 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
|
|
73
|
+
updated_at:
|
|
100
74
|
)
|
|
101
75
|
end
|
|
102
76
|
|
|
@@ -106,10 +80,10 @@ module Turbopuffer
|
|
|
106
80
|
approx_logical_bytes: Integer,
|
|
107
81
|
approx_row_count: Integer,
|
|
108
82
|
created_at: Time,
|
|
109
|
-
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
110
|
-
updated_at: Time,
|
|
111
83
|
encryption: Turbopuffer::NamespaceMetadata::Encryption::Variants,
|
|
112
|
-
index: Turbopuffer::NamespaceMetadata::Index::Variants
|
|
84
|
+
index: Turbopuffer::NamespaceMetadata::Index::Variants,
|
|
85
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
86
|
+
updated_at: Time
|
|
113
87
|
}
|
|
114
88
|
)
|
|
115
89
|
end
|
|
@@ -123,9 +97,37 @@ module Turbopuffer
|
|
|
123
97
|
|
|
124
98
|
Variants =
|
|
125
99
|
T.type_alias do
|
|
126
|
-
T.any(
|
|
100
|
+
T.any(
|
|
101
|
+
Turbopuffer::NamespaceMetadata::Encryption::Sse,
|
|
102
|
+
Turbopuffer::NamespaceMetadata::Encryption::Cmek
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
class Sse < Turbopuffer::Internal::Type::BaseModel
|
|
107
|
+
OrHash =
|
|
108
|
+
T.type_alias do
|
|
109
|
+
T.any(
|
|
110
|
+
Turbopuffer::NamespaceMetadata::Encryption::Sse,
|
|
111
|
+
Turbopuffer::Internal::AnyHash
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Always true. Indicates that the namespace is encrypted with SSE.
|
|
116
|
+
sig { returns(T::Boolean) }
|
|
117
|
+
attr_accessor :sse
|
|
118
|
+
|
|
119
|
+
sig { params(sse: T::Boolean).returns(T.attached_class) }
|
|
120
|
+
def self.new(
|
|
121
|
+
# Always true. Indicates that the namespace is encrypted with SSE.
|
|
122
|
+
sse:
|
|
123
|
+
)
|
|
127
124
|
end
|
|
128
125
|
|
|
126
|
+
sig { override.returns({ sse: T::Boolean }) }
|
|
127
|
+
def to_hash
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
129
131
|
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
130
132
|
OrHash =
|
|
131
133
|
T.type_alias do
|
|
@@ -136,9 +138,7 @@ module Turbopuffer
|
|
|
136
138
|
end
|
|
137
139
|
|
|
138
140
|
sig do
|
|
139
|
-
returns(
|
|
140
|
-
T.nilable(Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek)
|
|
141
|
-
)
|
|
141
|
+
returns(Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek)
|
|
142
142
|
end
|
|
143
143
|
attr_reader :cmek
|
|
144
144
|
|
|
@@ -158,7 +158,7 @@ module Turbopuffer
|
|
|
158
158
|
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek::OrHash
|
|
159
159
|
).returns(T.attached_class)
|
|
160
160
|
end
|
|
161
|
-
def self.new(cmek:
|
|
161
|
+
def self.new(cmek:)
|
|
162
162
|
end
|
|
163
163
|
|
|
164
164
|
sig do
|
|
@@ -210,16 +210,16 @@ module Turbopuffer
|
|
|
210
210
|
Variants =
|
|
211
211
|
T.type_alias do
|
|
212
212
|
T.any(
|
|
213
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
214
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
213
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpToDate,
|
|
214
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpdating
|
|
215
215
|
)
|
|
216
216
|
end
|
|
217
217
|
|
|
218
|
-
class
|
|
218
|
+
class IndexUpToDate < Turbopuffer::Internal::Type::BaseModel
|
|
219
219
|
OrHash =
|
|
220
220
|
T.type_alias do
|
|
221
221
|
T.any(
|
|
222
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
222
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpToDate,
|
|
223
223
|
Turbopuffer::Internal::AnyHash
|
|
224
224
|
)
|
|
225
225
|
end
|
|
@@ -236,11 +236,11 @@ module Turbopuffer
|
|
|
236
236
|
end
|
|
237
237
|
end
|
|
238
238
|
|
|
239
|
-
class
|
|
239
|
+
class IndexUpdating < Turbopuffer::Internal::Type::BaseModel
|
|
240
240
|
OrHash =
|
|
241
241
|
T.type_alias do
|
|
242
242
|
T.any(
|
|
243
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
243
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpdating,
|
|
244
244
|
Turbopuffer::Internal::AnyHash
|
|
245
245
|
)
|
|
246
246
|
end
|
|
@@ -17,7 +17,10 @@ module Turbopuffer
|
|
|
17
17
|
|
|
18
18
|
DEFAULT_MAX_CONNECTIONS: Integer
|
|
19
19
|
|
|
20
|
-
def self.connect: (
|
|
20
|
+
def self.connect: (
|
|
21
|
+
cert_store: OpenSSL::X509::Store,
|
|
22
|
+
url: URI::Generic
|
|
23
|
+
) -> top
|
|
21
24
|
|
|
22
25
|
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
|
23
26
|
|
|
@@ -2,17 +2,21 @@ module Turbopuffer
|
|
|
2
2
|
module Models
|
|
3
3
|
type attribute_schema_config =
|
|
4
4
|
{
|
|
5
|
-
|
|
5
|
+
type: String,
|
|
6
|
+
ann: Turbopuffer::Models::AttributeSchemaConfig::ann,
|
|
6
7
|
filterable: bool,
|
|
7
8
|
full_text_search: Turbopuffer::Models::full_text_search,
|
|
8
|
-
regex: bool
|
|
9
|
-
type: String
|
|
9
|
+
regex: bool
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
class AttributeSchemaConfig < Turbopuffer::Internal::Type::BaseModel
|
|
13
|
-
|
|
13
|
+
attr_accessor type: String
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
attr_reader ann: Turbopuffer::Models::AttributeSchemaConfig::ann?
|
|
16
|
+
|
|
17
|
+
def ann=: (
|
|
18
|
+
Turbopuffer::Models::AttributeSchemaConfig::ann
|
|
19
|
+
) -> Turbopuffer::Models::AttributeSchemaConfig::ann
|
|
16
20
|
|
|
17
21
|
attr_reader filterable: bool?
|
|
18
22
|
|
|
@@ -28,25 +32,48 @@ module Turbopuffer
|
|
|
28
32
|
|
|
29
33
|
def regex=: (bool) -> bool
|
|
30
34
|
|
|
31
|
-
attr_reader type: String?
|
|
32
|
-
|
|
33
|
-
def type=: (String) -> String
|
|
34
|
-
|
|
35
35
|
def initialize: (
|
|
36
|
-
|
|
36
|
+
type: String,
|
|
37
|
+
?ann: Turbopuffer::Models::AttributeSchemaConfig::ann,
|
|
37
38
|
?filterable: bool,
|
|
38
39
|
?full_text_search: Turbopuffer::Models::full_text_search,
|
|
39
|
-
?regex: bool
|
|
40
|
-
?type: String
|
|
40
|
+
?regex: bool
|
|
41
41
|
) -> void
|
|
42
42
|
|
|
43
43
|
def to_hash: -> {
|
|
44
|
-
|
|
44
|
+
type: String,
|
|
45
|
+
ann: Turbopuffer::Models::AttributeSchemaConfig::ann,
|
|
45
46
|
filterable: bool,
|
|
46
47
|
full_text_search: Turbopuffer::Models::full_text_search,
|
|
47
|
-
regex: bool
|
|
48
|
-
type: String
|
|
48
|
+
regex: bool
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
type ann = bool | Turbopuffer::AttributeSchemaConfig::Ann::AnnConfig
|
|
52
|
+
|
|
53
|
+
module Ann
|
|
54
|
+
extend Turbopuffer::Internal::Type::Union
|
|
55
|
+
|
|
56
|
+
type ann_config =
|
|
57
|
+
{ distance_metric: Turbopuffer::Models::distance_metric }
|
|
58
|
+
|
|
59
|
+
class AnnConfig < Turbopuffer::Internal::Type::BaseModel
|
|
60
|
+
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
|
61
|
+
|
|
62
|
+
def distance_metric=: (
|
|
63
|
+
Turbopuffer::Models::distance_metric
|
|
64
|
+
) -> Turbopuffer::Models::distance_metric
|
|
65
|
+
|
|
66
|
+
def initialize: (
|
|
67
|
+
?distance_metric: Turbopuffer::Models::distance_metric
|
|
68
|
+
) -> void
|
|
69
|
+
|
|
70
|
+
def to_hash: -> {
|
|
71
|
+
distance_metric: Turbopuffer::Models::distance_metric
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def self?.variants: -> ::Array[Turbopuffer::Models::AttributeSchemaConfig::ann]
|
|
76
|
+
end
|
|
50
77
|
end
|
|
51
78
|
end
|
|
52
79
|
end
|
|
@@ -5,10 +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],
|
|
9
|
-
updated_at: Time,
|
|
10
8
|
encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
11
|
-
index: Turbopuffer::Models::NamespaceMetadata::index
|
|
9
|
+
index: Turbopuffer::Models::NamespaceMetadata::index,
|
|
10
|
+
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
11
|
+
updated_at: Time
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
class NamespaceMetadata < Turbopuffer::Internal::Type::BaseModel
|
|
@@ -18,59 +18,59 @@ module Turbopuffer
|
|
|
18
18
|
|
|
19
19
|
attr_accessor created_at: Time
|
|
20
20
|
|
|
21
|
-
attr_accessor
|
|
22
|
-
|
|
23
|
-
attr_accessor updated_at: Time
|
|
21
|
+
attr_accessor encryption: Turbopuffer::Models::NamespaceMetadata::encryption
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
attr_accessor index: Turbopuffer::Models::NamespaceMetadata::index
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
Turbopuffer::Models::NamespaceMetadata::encryption
|
|
29
|
-
) -> Turbopuffer::Models::NamespaceMetadata::encryption
|
|
30
|
-
|
|
31
|
-
attr_reader index: Turbopuffer::Models::NamespaceMetadata::index?
|
|
25
|
+
attr_accessor schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
Turbopuffer::Models::NamespaceMetadata::index
|
|
35
|
-
) -> Turbopuffer::Models::NamespaceMetadata::index
|
|
27
|
+
attr_accessor updated_at: Time
|
|
36
28
|
|
|
37
29
|
def initialize: (
|
|
38
30
|
approx_logical_bytes: Integer,
|
|
39
31
|
approx_row_count: Integer,
|
|
40
32
|
created_at: Time,
|
|
33
|
+
encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
34
|
+
index: Turbopuffer::Models::NamespaceMetadata::index,
|
|
41
35
|
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
42
|
-
updated_at: Time
|
|
43
|
-
?encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
44
|
-
?index: Turbopuffer::Models::NamespaceMetadata::index
|
|
36
|
+
updated_at: Time
|
|
45
37
|
) -> void
|
|
46
38
|
|
|
47
39
|
def to_hash: -> {
|
|
48
40
|
approx_logical_bytes: Integer,
|
|
49
41
|
approx_row_count: Integer,
|
|
50
42
|
created_at: Time,
|
|
51
|
-
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
52
|
-
updated_at: Time,
|
|
53
43
|
encryption: Turbopuffer::Models::NamespaceMetadata::encryption,
|
|
54
|
-
index: Turbopuffer::Models::NamespaceMetadata::index
|
|
44
|
+
index: Turbopuffer::Models::NamespaceMetadata::index,
|
|
45
|
+
schema: ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig],
|
|
46
|
+
updated_at: Time
|
|
55
47
|
}
|
|
56
48
|
|
|
57
|
-
type encryption =
|
|
49
|
+
type encryption =
|
|
50
|
+
Turbopuffer::NamespaceMetadata::Encryption::Sse
|
|
51
|
+
| Turbopuffer::NamespaceMetadata::Encryption::Cmek
|
|
58
52
|
|
|
59
53
|
module Encryption
|
|
60
54
|
extend Turbopuffer::Internal::Type::Union
|
|
61
55
|
|
|
56
|
+
type sse = { sse: bool }
|
|
57
|
+
|
|
58
|
+
class Sse < Turbopuffer::Internal::Type::BaseModel
|
|
59
|
+
attr_accessor sse: bool
|
|
60
|
+
|
|
61
|
+
def initialize: (sse: bool) -> void
|
|
62
|
+
|
|
63
|
+
def to_hash: -> { sse: bool }
|
|
64
|
+
end
|
|
65
|
+
|
|
62
66
|
type cmek =
|
|
63
67
|
{ cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek }
|
|
64
68
|
|
|
65
69
|
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
def cmek=: (
|
|
69
|
-
Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
70
|
-
) -> Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
70
|
+
attr_accessor cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
71
71
|
|
|
72
72
|
def initialize: (
|
|
73
|
-
|
|
73
|
+
cmek: Turbopuffer::NamespaceMetadata::Encryption::Cmek::Cmek
|
|
74
74
|
) -> void
|
|
75
75
|
|
|
76
76
|
def to_hash: -> {
|
|
@@ -92,15 +92,15 @@ module Turbopuffer
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
type index =
|
|
95
|
-
Turbopuffer::NamespaceMetadata::Index::
|
|
96
|
-
| Turbopuffer::NamespaceMetadata::Index::
|
|
95
|
+
Turbopuffer::NamespaceMetadata::Index::IndexUpToDate
|
|
96
|
+
| Turbopuffer::NamespaceMetadata::Index::IndexUpdating
|
|
97
97
|
|
|
98
98
|
module Index
|
|
99
99
|
extend Turbopuffer::Internal::Type::Union
|
|
100
100
|
|
|
101
|
-
type
|
|
101
|
+
type index_up_to_date = { status: :"up-to-date" }
|
|
102
102
|
|
|
103
|
-
class
|
|
103
|
+
class IndexUpToDate < Turbopuffer::Internal::Type::BaseModel
|
|
104
104
|
attr_accessor status: :"up-to-date"
|
|
105
105
|
|
|
106
106
|
def initialize: (?status: :"up-to-date") -> void
|
|
@@ -108,9 +108,9 @@ module Turbopuffer
|
|
|
108
108
|
def to_hash: -> { status: :"up-to-date" }
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
type
|
|
111
|
+
type index_updating = { status: :updating, unindexed_bytes: Integer }
|
|
112
112
|
|
|
113
|
-
class
|
|
113
|
+
class IndexUpdating < Turbopuffer::Internal::Type::BaseModel
|
|
114
114
|
attr_accessor status: :updating
|
|
115
115
|
|
|
116
116
|
attr_accessor unindexed_bytes: Integer
|
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.6.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-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: connection_pool
|