turbopuffer 2.7.0 → 2.9.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 +22 -0
- data/README.md +15 -1
- data/lib/turbopuffer/client.rb +7 -0
- data/lib/turbopuffer/internal/respond_async.rb +1 -1
- data/lib/turbopuffer/internal/telemetry.rb +462 -0
- data/lib/turbopuffer/internal/transport/base_client.rb +50 -21
- data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +77 -2
- data/lib/turbopuffer/internal/transport/request_observer.rb +377 -0
- data/lib/turbopuffer/models/attribute_schema_config.rb +1 -0
- data/lib/turbopuffer/models/branch_from_namespace_params.rb +3 -0
- data/lib/turbopuffer/models/copy_from_namespace_operation.rb +8 -1
- data/lib/turbopuffer/models/copy_from_namespace_operation_result.rb +5 -3
- data/lib/turbopuffer/models/copy_from_namespace_params.rb +3 -0
- data/lib/turbopuffer/models/full_text_search.rb +1 -0
- data/lib/turbopuffer/models/id.rb +1 -1
- data/lib/turbopuffer/models/namespace_hint_cache_warm_response.rb +2 -1
- data/lib/turbopuffer/models/namespace_metadata.rb +10 -1
- data/lib/turbopuffer/models/namespace_metadata_patch.rb +1 -0
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +1 -0
- data/lib/turbopuffer/models/namespace_multi_query_response.rb +19 -2
- data/lib/turbopuffer/models/namespace_query_params.rb +9 -1
- data/lib/turbopuffer/models/namespace_query_response.rb +10 -2
- data/lib/turbopuffer/models/namespace_recall_response.rb +5 -0
- data/lib/turbopuffer/models/namespace_start_copy_from_response.rb +2 -0
- data/lib/turbopuffer/models/namespace_write_params.rb +3 -3
- data/lib/turbopuffer/models/operation_error.rb +2 -0
- data/lib/turbopuffer/models/rerank_model_params.rb +38 -0
- data/lib/turbopuffer/models/write_result.rb +1 -1
- data/lib/turbopuffer/models.rb +2 -0
- data/lib/turbopuffer/resources/namespaces.rb +4 -2
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +3 -0
- data/rbi/turbopuffer/client.rbi +5 -0
- data/rbi/turbopuffer/internal/telemetry.rbi +275 -0
- data/rbi/turbopuffer/internal/transport/base_client.rbi +13 -2
- data/rbi/turbopuffer/internal/transport/pooled_net_requester.rbi +47 -1
- data/rbi/turbopuffer/internal/transport/request_observer.rbi +340 -0
- data/rbi/turbopuffer/models/branch_from_namespace_params.rbi +1 -0
- data/rbi/turbopuffer/models/copy_from_namespace_operation.rbi +4 -0
- data/rbi/turbopuffer/models/copy_from_namespace_operation_result.rbi +8 -3
- data/rbi/turbopuffer/models/copy_from_namespace_params.rbi +1 -0
- data/rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi +2 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +5 -0
- data/rbi/turbopuffer/models/namespace_multi_query_response.rbi +17 -1
- data/rbi/turbopuffer/models/namespace_query_params.rbi +11 -0
- data/rbi/turbopuffer/models/namespace_query_response.rbi +8 -1
- data/rbi/turbopuffer/models/namespace_recall_response.rbi +4 -0
- data/rbi/turbopuffer/models/namespace_start_copy_from_response.rbi +1 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +3 -3
- data/rbi/turbopuffer/models/operation_error.rbi +1 -0
- data/rbi/turbopuffer/models/rerank_model_params.rbi +48 -0
- data/rbi/turbopuffer/models/write_result.rbi +1 -1
- data/rbi/turbopuffer/models.rbi +2 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +5 -1
- data/sig/turbopuffer/client.rbs +1 -0
- data/sig/turbopuffer/internal/telemetry.rbs +129 -0
- data/sig/turbopuffer/internal/transport/base_client.rbs +5 -1
- data/sig/turbopuffer/internal/transport/pooled_net_requester.rbs +15 -1
- data/sig/turbopuffer/internal/transport/request_observer.rbs +153 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +9 -0
- data/sig/turbopuffer/models/rerank_model_params.rbs +18 -0
- data/sig/turbopuffer/models.rbs +2 -0
- data/sig/turbopuffer/resources/namespaces.rbs +1 -0
- metadata +11 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
module Turbopuffer
|
|
2
|
+
module Internal
|
|
3
|
+
module Transport
|
|
4
|
+
class RequestObserver
|
|
5
|
+
def start: (
|
|
6
|
+
Turbopuffer::Internal::Transport::RequestObserver::RequestInfo info
|
|
7
|
+
) -> Turbopuffer::Internal::Transport::RequestObserver::RequestScope?
|
|
8
|
+
|
|
9
|
+
class RequestScope
|
|
10
|
+
def attempt_begin: (
|
|
11
|
+
Integer attempt,
|
|
12
|
+
::Hash[Symbol, top] request
|
|
13
|
+
) -> void
|
|
14
|
+
|
|
15
|
+
def attempt_end: (
|
|
16
|
+
Turbopuffer::Internal::Transport::RequestObserver::AttemptResult result
|
|
17
|
+
) -> void
|
|
18
|
+
|
|
19
|
+
def finish: (
|
|
20
|
+
Turbopuffer::Internal::Transport::RequestObserver::RequestResult result
|
|
21
|
+
) -> void
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class RequestInfo
|
|
25
|
+
attr_reader method: Symbol
|
|
26
|
+
|
|
27
|
+
attr_reader url: String
|
|
28
|
+
|
|
29
|
+
def initialize: (method: Symbol, url: String) -> void
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class AttemptResult
|
|
33
|
+
attr_reader attempt: Integer
|
|
34
|
+
|
|
35
|
+
attr_reader request: ::Hash[Symbol, top]
|
|
36
|
+
|
|
37
|
+
attr_reader response: top
|
|
38
|
+
|
|
39
|
+
attr_reader error: Exception?
|
|
40
|
+
|
|
41
|
+
attr_reader error_kind: Symbol?
|
|
42
|
+
|
|
43
|
+
attr_reader reached_server: bool?
|
|
44
|
+
|
|
45
|
+
attr_reader timings: Turbopuffer::Internal::Transport::RequestObserver::Timings
|
|
46
|
+
|
|
47
|
+
def initialize: (
|
|
48
|
+
attempt: Integer,
|
|
49
|
+
request: ::Hash[Symbol, top],
|
|
50
|
+
response: top,
|
|
51
|
+
error: Exception?,
|
|
52
|
+
error_kind: Symbol?,
|
|
53
|
+
reached_server: bool?,
|
|
54
|
+
timings: Turbopuffer::Internal::Transport::RequestObserver::Timings
|
|
55
|
+
) -> void
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class RequestResult
|
|
59
|
+
attr_reader retries: Integer
|
|
60
|
+
|
|
61
|
+
attr_reader response: top
|
|
62
|
+
|
|
63
|
+
attr_reader error: Exception?
|
|
64
|
+
|
|
65
|
+
attr_reader error_kind: Symbol?
|
|
66
|
+
|
|
67
|
+
attr_reader parsed: top
|
|
68
|
+
|
|
69
|
+
attr_reader timings: Turbopuffer::Internal::Transport::RequestObserver::Timings
|
|
70
|
+
|
|
71
|
+
def initialize: (
|
|
72
|
+
retries: Integer,
|
|
73
|
+
response: top,
|
|
74
|
+
error: Exception?,
|
|
75
|
+
error_kind: Symbol?,
|
|
76
|
+
parsed: top,
|
|
77
|
+
timings: Turbopuffer::Internal::Transport::RequestObserver::Timings
|
|
78
|
+
) -> void
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
class Timings
|
|
82
|
+
attr_accessor attempt_begin: Integer?
|
|
83
|
+
|
|
84
|
+
attr_accessor serialize_begin: Integer?
|
|
85
|
+
|
|
86
|
+
attr_accessor serialize_end: Integer?
|
|
87
|
+
|
|
88
|
+
attr_accessor request_ready: Integer?
|
|
89
|
+
|
|
90
|
+
attr_accessor connect_begin: Integer?
|
|
91
|
+
|
|
92
|
+
attr_accessor connect_end: Integer?
|
|
93
|
+
|
|
94
|
+
attr_accessor send_begin: Integer?
|
|
95
|
+
|
|
96
|
+
attr_accessor send_end: Integer?
|
|
97
|
+
|
|
98
|
+
attr_accessor response_headers: Integer?
|
|
99
|
+
|
|
100
|
+
attr_accessor body_end: Integer?
|
|
101
|
+
|
|
102
|
+
attr_accessor deserialize_begin: Integer?
|
|
103
|
+
|
|
104
|
+
attr_accessor deserialize_end: Integer?
|
|
105
|
+
|
|
106
|
+
attr_accessor reused: bool?
|
|
107
|
+
|
|
108
|
+
attr_reader extra: ::Hash[Symbol, top]
|
|
109
|
+
|
|
110
|
+
def initialize: -> void
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
CONNECT_ERRORS: ::Array[Class]
|
|
114
|
+
|
|
115
|
+
def self.now: -> Integer
|
|
116
|
+
|
|
117
|
+
def self.call_safely: (Symbol hook) { -> top } -> top
|
|
118
|
+
|
|
119
|
+
def self.error_kind: (
|
|
120
|
+
Exception error,
|
|
121
|
+
Turbopuffer::Internal::Transport::RequestObserver::Timings timings
|
|
122
|
+
) -> Symbol
|
|
123
|
+
|
|
124
|
+
class Observation
|
|
125
|
+
def self.start: (
|
|
126
|
+
Turbopuffer::Internal::Transport::RequestObserver observer,
|
|
127
|
+
::Hash[Symbol, top] request,
|
|
128
|
+
Integer started_at,
|
|
129
|
+
path: String
|
|
130
|
+
) -> Turbopuffer::Internal::Transport::RequestObserver::Observation?
|
|
131
|
+
|
|
132
|
+
def attempt_begin: (
|
|
133
|
+
::Hash[Symbol, top] input,
|
|
134
|
+
retry_count: Integer
|
|
135
|
+
) -> ::Hash[Symbol, top]
|
|
136
|
+
|
|
137
|
+
def attempt_end: (Integer | Exception status, top response) -> void
|
|
138
|
+
|
|
139
|
+
def deserialize_begin: -> void
|
|
140
|
+
|
|
141
|
+
def finish: (?response: top, ?parsed: top, ?error: Exception?) -> void
|
|
142
|
+
|
|
143
|
+
def initialize: (
|
|
144
|
+
Turbopuffer::Internal::Transport::RequestObserver::RequestScope scope,
|
|
145
|
+
body: bool,
|
|
146
|
+
started_at: Integer,
|
|
147
|
+
built_at: Integer
|
|
148
|
+
) -> void
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
@@ -14,6 +14,7 @@ module Turbopuffer
|
|
|
14
14
|
limit: Turbopuffer::Models::NamespaceQueryParams::limit,
|
|
15
15
|
offset: Integer,
|
|
16
16
|
rank_by: top,
|
|
17
|
+
rerank_by: Turbopuffer::RerankModelParams,
|
|
17
18
|
top_k: Integer,
|
|
18
19
|
vector_encoding: Turbopuffer::Models::vector_encoding
|
|
19
20
|
}
|
|
@@ -79,6 +80,12 @@ module Turbopuffer
|
|
|
79
80
|
|
|
80
81
|
def rank_by=: (top) -> top
|
|
81
82
|
|
|
83
|
+
attr_reader rerank_by: Turbopuffer::RerankModelParams?
|
|
84
|
+
|
|
85
|
+
def rerank_by=: (
|
|
86
|
+
Turbopuffer::RerankModelParams
|
|
87
|
+
) -> Turbopuffer::RerankModelParams
|
|
88
|
+
|
|
82
89
|
attr_reader top_k: Integer?
|
|
83
90
|
|
|
84
91
|
def top_k=: (Integer) -> Integer
|
|
@@ -102,6 +109,7 @@ module Turbopuffer
|
|
|
102
109
|
?limit: Turbopuffer::Models::NamespaceQueryParams::limit,
|
|
103
110
|
?offset: Integer,
|
|
104
111
|
?rank_by: top,
|
|
112
|
+
?rerank_by: Turbopuffer::RerankModelParams,
|
|
105
113
|
?top_k: Integer,
|
|
106
114
|
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
|
107
115
|
?request_options: Turbopuffer::request_opts
|
|
@@ -120,6 +128,7 @@ module Turbopuffer
|
|
|
120
128
|
limit: Turbopuffer::Models::NamespaceQueryParams::limit,
|
|
121
129
|
offset: Integer,
|
|
122
130
|
rank_by: top,
|
|
131
|
+
rerank_by: Turbopuffer::RerankModelParams,
|
|
123
132
|
top_k: Integer,
|
|
124
133
|
vector_encoding: Turbopuffer::Models::vector_encoding,
|
|
125
134
|
request_options: Turbopuffer::RequestOptions
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Turbopuffer
|
|
2
|
+
module Models
|
|
3
|
+
type rerank_model_params =
|
|
4
|
+
{ attribute: String, model: String, query: String }
|
|
5
|
+
|
|
6
|
+
class RerankModelParams < Turbopuffer::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor attribute: String
|
|
8
|
+
|
|
9
|
+
attr_accessor model: String
|
|
10
|
+
|
|
11
|
+
attr_accessor query: String
|
|
12
|
+
|
|
13
|
+
def initialize: (attribute: String, model: String, query: String) -> void
|
|
14
|
+
|
|
15
|
+
def to_hash: -> { attribute: String, model: String, query: String }
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/sig/turbopuffer/models.rbs
CHANGED
|
@@ -107,6 +107,8 @@ module Turbopuffer
|
|
|
107
107
|
|
|
108
108
|
class RerankLimit = Turbopuffer::Models::RerankLimit
|
|
109
109
|
|
|
110
|
+
class RerankModelParams = Turbopuffer::Models::RerankModelParams
|
|
111
|
+
|
|
110
112
|
class Row = Turbopuffer::Models::Row
|
|
111
113
|
|
|
112
114
|
class RrfParams = Turbopuffer::Models::RrfParams
|
|
@@ -79,6 +79,7 @@ module Turbopuffer
|
|
|
79
79
|
?limit: Turbopuffer::Models::NamespaceQueryParams::limit,
|
|
80
80
|
?offset: Integer,
|
|
81
81
|
?rank_by: top,
|
|
82
|
+
?rerank_by: Turbopuffer::RerankModelParams,
|
|
82
83
|
?top_k: Integer,
|
|
83
84
|
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
|
84
85
|
?request_options: Turbopuffer::request_opts
|
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: 2.
|
|
4
|
+
version: 2.9.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-10-
|
|
11
|
+
date: 2026-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -56,8 +56,10 @@ files:
|
|
|
56
56
|
- lib/turbopuffer/internal.rb
|
|
57
57
|
- lib/turbopuffer/internal/namespace_page.rb
|
|
58
58
|
- lib/turbopuffer/internal/respond_async.rb
|
|
59
|
+
- lib/turbopuffer/internal/telemetry.rb
|
|
59
60
|
- lib/turbopuffer/internal/transport/base_client.rb
|
|
60
61
|
- lib/turbopuffer/internal/transport/pooled_net_requester.rb
|
|
62
|
+
- lib/turbopuffer/internal/transport/request_observer.rb
|
|
61
63
|
- lib/turbopuffer/internal/type/array_of.rb
|
|
62
64
|
- lib/turbopuffer/internal/type/base_model.rb
|
|
63
65
|
- lib/turbopuffer/internal/type/base_page.rb
|
|
@@ -137,6 +139,7 @@ files:
|
|
|
137
139
|
- lib/turbopuffer/models/query_billing.rb
|
|
138
140
|
- lib/turbopuffer/models/query_performance.rb
|
|
139
141
|
- lib/turbopuffer/models/rerank_limit.rb
|
|
142
|
+
- lib/turbopuffer/models/rerank_model_params.rb
|
|
140
143
|
- lib/turbopuffer/models/row.rb
|
|
141
144
|
- lib/turbopuffer/models/rrf_params.rb
|
|
142
145
|
- lib/turbopuffer/models/saturate_params.rb
|
|
@@ -158,8 +161,10 @@ files:
|
|
|
158
161
|
- rbi/turbopuffer/file_part.rbi
|
|
159
162
|
- rbi/turbopuffer/internal.rbi
|
|
160
163
|
- rbi/turbopuffer/internal/namespace_page.rbi
|
|
164
|
+
- rbi/turbopuffer/internal/telemetry.rbi
|
|
161
165
|
- rbi/turbopuffer/internal/transport/base_client.rbi
|
|
162
166
|
- rbi/turbopuffer/internal/transport/pooled_net_requester.rbi
|
|
167
|
+
- rbi/turbopuffer/internal/transport/request_observer.rbi
|
|
163
168
|
- rbi/turbopuffer/internal/type/array_of.rbi
|
|
164
169
|
- rbi/turbopuffer/internal/type/base_model.rbi
|
|
165
170
|
- rbi/turbopuffer/internal/type/base_page.rbi
|
|
@@ -239,6 +244,7 @@ files:
|
|
|
239
244
|
- rbi/turbopuffer/models/query_billing.rbi
|
|
240
245
|
- rbi/turbopuffer/models/query_performance.rbi
|
|
241
246
|
- rbi/turbopuffer/models/rerank_limit.rbi
|
|
247
|
+
- rbi/turbopuffer/models/rerank_model_params.rbi
|
|
242
248
|
- rbi/turbopuffer/models/row.rbi
|
|
243
249
|
- rbi/turbopuffer/models/rrf_params.rbi
|
|
244
250
|
- rbi/turbopuffer/models/saturate_params.rbi
|
|
@@ -259,8 +265,10 @@ files:
|
|
|
259
265
|
- sig/turbopuffer/file_part.rbs
|
|
260
266
|
- sig/turbopuffer/internal.rbs
|
|
261
267
|
- sig/turbopuffer/internal/namespace_page.rbs
|
|
268
|
+
- sig/turbopuffer/internal/telemetry.rbs
|
|
262
269
|
- sig/turbopuffer/internal/transport/base_client.rbs
|
|
263
270
|
- sig/turbopuffer/internal/transport/pooled_net_requester.rbs
|
|
271
|
+
- sig/turbopuffer/internal/transport/request_observer.rbs
|
|
264
272
|
- sig/turbopuffer/internal/type/array_of.rbs
|
|
265
273
|
- sig/turbopuffer/internal/type/base_model.rbs
|
|
266
274
|
- sig/turbopuffer/internal/type/base_page.rbs
|
|
@@ -340,6 +348,7 @@ files:
|
|
|
340
348
|
- sig/turbopuffer/models/query_billing.rbs
|
|
341
349
|
- sig/turbopuffer/models/query_performance.rbs
|
|
342
350
|
- sig/turbopuffer/models/rerank_limit.rbs
|
|
351
|
+
- sig/turbopuffer/models/rerank_model_params.rbs
|
|
343
352
|
- sig/turbopuffer/models/row.rbs
|
|
344
353
|
- sig/turbopuffer/models/rrf_params.rbs
|
|
345
354
|
- sig/turbopuffer/models/saturate_params.rbs
|