turbopuffer 1.14.1 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -1
- data/lib/turbopuffer/client.rb +2 -1
- data/lib/turbopuffer/internal/util.rb +31 -0
- data/lib/turbopuffer/models/namespace_recall_params.rb +1 -10
- data/lib/turbopuffer/resources/namespaces.rb +1 -3
- data/lib/turbopuffer/version.rb +1 -1
- data/rbi/turbopuffer/internal/util.rbi +20 -0
- data/rbi/turbopuffer/models/namespace_recall_params.rbi +0 -13
- data/rbi/turbopuffer/resources/namespaces.rbi +0 -4
- data/sig/turbopuffer/internal/util.rbs +10 -0
- data/sig/turbopuffer/models/namespace_recall_params.rbs +0 -7
- data/sig/turbopuffer/resources/namespaces.rbs +0 -1
- 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: d93c4326ad60ebf3230bdfd44b88780b78c570cc3cfd190c30598496fb8daae2
|
|
4
|
+
data.tar.gz: dba2783100f870dec7a9c1e4ab25b827bb250d152a10285eed15bfcc4cb5e42e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 785fd8000ef7c93c1713bba7773dc9d8feef8a5744313eb41581dbaf8e4ee0bf4e978a0d57406506867c9decfc2561d2d59f5965749773200cdcf82e9fa7a3b7
|
|
7
|
+
data.tar.gz: ce4b4286148453f962a04ae4a4608b625e4a44bfb4ebd67731939ef58cc4da5c6f7aedefcc304390a19db07b564fc328b93fc1491e170dbdb50be45ff83f14aa
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.15.0 (2026-03-03)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.14.1...v1.15.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.14.1...v1.15.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Remove `queries` from recall endpoint ([04d1dcd](https://github.com/turbopuffer/turbopuffer-ruby/commit/04d1dcd4e57ff0ba0a278011fa7d3834f3fec681))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **client:** serialize query parameters properly ([2b88e7d](https://github.com/turbopuffer/turbopuffer-ruby/commit/2b88e7dcb9c4b09eee1019993a01e6818102357c))
|
|
15
|
+
* properly mock time in ruby ci tests ([1a1f81d](https://github.com/turbopuffer/turbopuffer-ruby/commit/1a1f81d3952a0e040ecf572724152ebd76ad6092))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Chores
|
|
19
|
+
|
|
20
|
+
* **ci:** add build step ([7b0fe2f](https://github.com/turbopuffer/turbopuffer-ruby/commit/7b0fe2ff926fe87953963e314fc9534ce243fce0))
|
|
21
|
+
|
|
3
22
|
## 1.14.1 (2026-02-19)
|
|
4
23
|
|
|
5
24
|
Full Changelog: [v1.14.0...v1.14.1](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.14.0...v1.14.1)
|
data/README.md
CHANGED
data/lib/turbopuffer/client.rb
CHANGED
|
@@ -52,10 +52,11 @@ module Turbopuffer
|
|
|
52
52
|
# @see Turbopuffer::Models::ClientNamespacesParams
|
|
53
53
|
def namespaces(params = {})
|
|
54
54
|
parsed, options = Turbopuffer::ClientNamespacesParams.dump_request(params)
|
|
55
|
+
query = Turbopuffer::Internal::Util.encode_query_params(parsed)
|
|
55
56
|
request(
|
|
56
57
|
method: :get,
|
|
57
58
|
path: "v1/namespaces",
|
|
58
|
-
query:
|
|
59
|
+
query: query,
|
|
59
60
|
page: Turbopuffer::Internal::NamespacePage,
|
|
60
61
|
model: Turbopuffer::NamespaceSummary,
|
|
61
62
|
options: options
|
|
@@ -490,6 +490,37 @@ module Turbopuffer
|
|
|
490
490
|
JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}
|
|
491
491
|
|
|
492
492
|
class << self
|
|
493
|
+
# @api private
|
|
494
|
+
#
|
|
495
|
+
# @param query [Hash{Symbol=>Object}]
|
|
496
|
+
#
|
|
497
|
+
# @return [Hash{Symbol=>Object}]
|
|
498
|
+
def encode_query_params(query)
|
|
499
|
+
out = {}
|
|
500
|
+
query.each { write_query_param_element!(out, _1, _2) }
|
|
501
|
+
out
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
# @api private
|
|
505
|
+
#
|
|
506
|
+
# @param collection [Hash{Symbol=>Object}]
|
|
507
|
+
# @param key [String]
|
|
508
|
+
# @param element [Object]
|
|
509
|
+
#
|
|
510
|
+
# @return [nil]
|
|
511
|
+
private def write_query_param_element!(collection, key, element)
|
|
512
|
+
case element
|
|
513
|
+
in Hash
|
|
514
|
+
element.each do |name, value|
|
|
515
|
+
write_query_param_element!(collection, "#{key}[#{name}]", value)
|
|
516
|
+
end
|
|
517
|
+
in Array
|
|
518
|
+
collection[key] = element.map(&:to_s).join(",")
|
|
519
|
+
else
|
|
520
|
+
collection[key] = element.to_s
|
|
521
|
+
end
|
|
522
|
+
end
|
|
523
|
+
|
|
493
524
|
# @api private
|
|
494
525
|
#
|
|
495
526
|
# @param y [Enumerator::Yielder]
|
|
@@ -31,20 +31,13 @@ module Turbopuffer
|
|
|
31
31
|
# @return [Integer, nil]
|
|
32
32
|
optional :num, Integer
|
|
33
33
|
|
|
34
|
-
# @!attribute queries
|
|
35
|
-
# Use specific query vectors for the measurement. If omitted, sampled from the
|
|
36
|
-
# index.
|
|
37
|
-
#
|
|
38
|
-
# @return [Array<Float>, nil]
|
|
39
|
-
optional :queries, Turbopuffer::Internal::Type::ArrayOf[Float]
|
|
40
|
-
|
|
41
34
|
# @!attribute top_k
|
|
42
35
|
# Search for `top_k` nearest neighbors.
|
|
43
36
|
#
|
|
44
37
|
# @return [Integer, nil]
|
|
45
38
|
optional :top_k, Integer
|
|
46
39
|
|
|
47
|
-
# @!method initialize(namespace: nil, filters: nil, include_ground_truth: nil, num: nil,
|
|
40
|
+
# @!method initialize(namespace: nil, filters: nil, include_ground_truth: nil, num: nil, top_k: nil, request_options: {})
|
|
48
41
|
# Some parameter documentations has been truncated, see
|
|
49
42
|
# {Turbopuffer::Models::NamespaceRecallParams} for more details.
|
|
50
43
|
#
|
|
@@ -56,8 +49,6 @@ module Turbopuffer
|
|
|
56
49
|
#
|
|
57
50
|
# @param num [Integer] The number of searches to run.
|
|
58
51
|
#
|
|
59
|
-
# @param queries [Array<Float>] Use specific query vectors for the measurement. If omitted, sampled from the ind
|
|
60
|
-
#
|
|
61
52
|
# @param top_k [Integer] Search for `top_k` nearest neighbors.
|
|
62
53
|
#
|
|
63
54
|
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
|
|
@@ -217,7 +217,7 @@ module Turbopuffer
|
|
|
217
217
|
#
|
|
218
218
|
# Evaluate recall.
|
|
219
219
|
#
|
|
220
|
-
# @overload recall(namespace: nil, filters: nil, include_ground_truth: nil, num: nil,
|
|
220
|
+
# @overload recall(namespace: nil, filters: nil, include_ground_truth: nil, num: nil, top_k: nil, request_options: {})
|
|
221
221
|
#
|
|
222
222
|
# @param namespace [String] Path param: The name of the namespace.
|
|
223
223
|
#
|
|
@@ -227,8 +227,6 @@ module Turbopuffer
|
|
|
227
227
|
#
|
|
228
228
|
# @param num [Integer] Body param: The number of searches to run.
|
|
229
229
|
#
|
|
230
|
-
# @param queries [Array<Float>] Body param: Use specific query vectors for the measurement. If omitted, sampled
|
|
231
|
-
#
|
|
232
230
|
# @param top_k [Integer] Body param: Search for `top_k` nearest neighbors.
|
|
233
231
|
#
|
|
234
232
|
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
data/lib/turbopuffer/version.rb
CHANGED
|
@@ -301,6 +301,26 @@ module Turbopuffer
|
|
|
301
301
|
T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp)
|
|
302
302
|
|
|
303
303
|
class << self
|
|
304
|
+
# @api private
|
|
305
|
+
sig do
|
|
306
|
+
params(query: Turbopuffer::Internal::AnyHash).returns(
|
|
307
|
+
Turbopuffer::Internal::AnyHash
|
|
308
|
+
)
|
|
309
|
+
end
|
|
310
|
+
def encode_query_params(query)
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# @api private
|
|
314
|
+
sig do
|
|
315
|
+
params(
|
|
316
|
+
collection: Turbopuffer::Internal::AnyHash,
|
|
317
|
+
key: String,
|
|
318
|
+
element: T.anything
|
|
319
|
+
).void
|
|
320
|
+
end
|
|
321
|
+
private def write_query_param_element!(collection, key, element)
|
|
322
|
+
end
|
|
323
|
+
|
|
304
324
|
# @api private
|
|
305
325
|
sig do
|
|
306
326
|
params(
|
|
@@ -42,14 +42,6 @@ module Turbopuffer
|
|
|
42
42
|
sig { params(num: Integer).void }
|
|
43
43
|
attr_writer :num
|
|
44
44
|
|
|
45
|
-
# Use specific query vectors for the measurement. If omitted, sampled from the
|
|
46
|
-
# index.
|
|
47
|
-
sig { returns(T.nilable(T::Array[Float])) }
|
|
48
|
-
attr_reader :queries
|
|
49
|
-
|
|
50
|
-
sig { params(queries: T::Array[Float]).void }
|
|
51
|
-
attr_writer :queries
|
|
52
|
-
|
|
53
45
|
# Search for `top_k` nearest neighbors.
|
|
54
46
|
sig { returns(T.nilable(Integer)) }
|
|
55
47
|
attr_reader :top_k
|
|
@@ -63,7 +55,6 @@ module Turbopuffer
|
|
|
63
55
|
filters: T.anything,
|
|
64
56
|
include_ground_truth: T::Boolean,
|
|
65
57
|
num: Integer,
|
|
66
|
-
queries: T::Array[Float],
|
|
67
58
|
top_k: Integer,
|
|
68
59
|
request_options: Turbopuffer::RequestOptions::OrHash
|
|
69
60
|
).returns(T.attached_class)
|
|
@@ -77,9 +68,6 @@ module Turbopuffer
|
|
|
77
68
|
include_ground_truth: nil,
|
|
78
69
|
# The number of searches to run.
|
|
79
70
|
num: nil,
|
|
80
|
-
# Use specific query vectors for the measurement. If omitted, sampled from the
|
|
81
|
-
# index.
|
|
82
|
-
queries: nil,
|
|
83
71
|
# Search for `top_k` nearest neighbors.
|
|
84
72
|
top_k: nil,
|
|
85
73
|
request_options: {}
|
|
@@ -93,7 +81,6 @@ module Turbopuffer
|
|
|
93
81
|
filters: T.anything,
|
|
94
82
|
include_ground_truth: T::Boolean,
|
|
95
83
|
num: Integer,
|
|
96
|
-
queries: T::Array[Float],
|
|
97
84
|
top_k: Integer,
|
|
98
85
|
request_options: Turbopuffer::RequestOptions
|
|
99
86
|
}
|
|
@@ -179,7 +179,6 @@ module Turbopuffer
|
|
|
179
179
|
filters: T.anything,
|
|
180
180
|
include_ground_truth: T::Boolean,
|
|
181
181
|
num: Integer,
|
|
182
|
-
queries: T::Array[Float],
|
|
183
182
|
top_k: Integer,
|
|
184
183
|
request_options: Turbopuffer::RequestOptions::OrHash
|
|
185
184
|
).returns(Turbopuffer::Models::NamespaceRecallResponse)
|
|
@@ -194,9 +193,6 @@ module Turbopuffer
|
|
|
194
193
|
include_ground_truth: nil,
|
|
195
194
|
# Body param: The number of searches to run.
|
|
196
195
|
num: nil,
|
|
197
|
-
# Body param: Use specific query vectors for the measurement. If omitted, sampled
|
|
198
|
-
# from the index.
|
|
199
|
-
queries: nil,
|
|
200
196
|
# Body param: Search for `top_k` nearest neighbors.
|
|
201
197
|
top_k: nil,
|
|
202
198
|
request_options: {}
|
|
@@ -106,6 +106,16 @@ module Turbopuffer
|
|
|
106
106
|
JSON_CONTENT: Regexp
|
|
107
107
|
JSONL_CONTENT: Regexp
|
|
108
108
|
|
|
109
|
+
def encode_query_params: (
|
|
110
|
+
::Hash[Symbol, top] query
|
|
111
|
+
) -> ::Hash[Symbol, top]
|
|
112
|
+
|
|
113
|
+
private def write_query_param_element!: (
|
|
114
|
+
::Hash[Symbol, top] collection,
|
|
115
|
+
String key,
|
|
116
|
+
top element
|
|
117
|
+
) -> nil
|
|
118
|
+
|
|
109
119
|
def self?.write_multipart_content: (
|
|
110
120
|
Enumerator::Yielder y,
|
|
111
121
|
val: top,
|
|
@@ -6,7 +6,6 @@ module Turbopuffer
|
|
|
6
6
|
filters: top,
|
|
7
7
|
include_ground_truth: bool,
|
|
8
8
|
num: Integer,
|
|
9
|
-
queries: ::Array[Float],
|
|
10
9
|
top_k: Integer
|
|
11
10
|
}
|
|
12
11
|
& Turbopuffer::Internal::Type::request_parameters
|
|
@@ -31,10 +30,6 @@ module Turbopuffer
|
|
|
31
30
|
|
|
32
31
|
def num=: (Integer) -> Integer
|
|
33
32
|
|
|
34
|
-
attr_reader queries: ::Array[Float]?
|
|
35
|
-
|
|
36
|
-
def queries=: (::Array[Float]) -> ::Array[Float]
|
|
37
|
-
|
|
38
33
|
attr_reader top_k: Integer?
|
|
39
34
|
|
|
40
35
|
def top_k=: (Integer) -> Integer
|
|
@@ -44,7 +39,6 @@ module Turbopuffer
|
|
|
44
39
|
?filters: top,
|
|
45
40
|
?include_ground_truth: bool,
|
|
46
41
|
?num: Integer,
|
|
47
|
-
?queries: ::Array[Float],
|
|
48
42
|
?top_k: Integer,
|
|
49
43
|
?request_options: Turbopuffer::request_opts
|
|
50
44
|
) -> void
|
|
@@ -54,7 +48,6 @@ module Turbopuffer
|
|
|
54
48
|
filters: top,
|
|
55
49
|
include_ground_truth: bool,
|
|
56
50
|
num: Integer,
|
|
57
|
-
queries: ::Array[Float],
|
|
58
51
|
top_k: Integer,
|
|
59
52
|
request_options: Turbopuffer::RequestOptions
|
|
60
53
|
}
|
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.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Turbopuffer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-03-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|