turbopuffer-ruby 0.2.3 → 0.2.4
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 +14 -0
- data/README.md +9 -9
- data/lib/turbopuffer/internal/transport/base_client.rb +1 -1
- data/lib/turbopuffer/models/full_text_search_config.rb +11 -1
- data/lib/turbopuffer/models/namespace_explain_query_params.rb +128 -0
- data/lib/turbopuffer/models/namespace_explain_query_response.rb +19 -0
- data/lib/turbopuffer/models.rb +2 -0
- data/lib/turbopuffer/resources/namespaces.rb +47 -0
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +2 -0
- data/rbi/turbopuffer/internal/transport/base_client.rbi +1 -1
- data/rbi/turbopuffer/models/full_text_search_config.rbi +15 -0
- data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +260 -0
- data/rbi/turbopuffer/models/namespace_explain_query_response.rbi +34 -0
- data/rbi/turbopuffer/models.rbi +2 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +45 -0
- data/sig/turbopuffer/internal/transport/base_client.rbs +1 -1
- data/sig/turbopuffer/models/full_text_search_config.rbs +7 -0
- data/sig/turbopuffer/models/namespace_explain_query_params.rbs +134 -0
- data/sig/turbopuffer/models/namespace_explain_query_response.rbs +15 -0
- data/sig/turbopuffer/models.rbs +2 -0
- data/sig/turbopuffer/resources/namespaces.rbs +14 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cdba184c47706f13e46349844edd154024ecb50b0cd898b1e472bee7122595f
|
4
|
+
data.tar.gz: d2a2652222e2e672c9069bc965ece1bac43351804670331410aa91462eaa1f7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c42de89acf1dc7246fb9ef1ad915bb0e5d0c1bdb74b1d842851d3eeb576ed8ed3cc2047d6d255053b7a21bd7561dbf6a757620ff2ec9099ada4c9a98ddfc487
|
7
|
+
data.tar.gz: 25b6fdfc5c41998e5bb415ecebd39f6b8c6583047bf44a27714363044ffa7c70d86d53ae7e17379514885e8c4ac2191c1e7e292ea0d9aecb8e6b273ded29452d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.2.4 (2025-08-01)
|
4
|
+
|
5
|
+
Full Changelog: [v0.2.3...v0.2.4](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.3...v0.2.4)
|
6
|
+
|
7
|
+
### Bug Fixes
|
8
|
+
|
9
|
+
* **api:** api update ([900bd73](https://github.com/turbopuffer/turbopuffer-ruby/commit/900bd73a945bdb8af7d1c23d7f44a359a154c1aa))
|
10
|
+
* **api:** api update ([d63b961](https://github.com/turbopuffer/turbopuffer-ruby/commit/d63b9613a0827be0969a218a29df23934ef8c46f))
|
11
|
+
|
12
|
+
|
13
|
+
### Chores
|
14
|
+
|
15
|
+
* **internal:** increase visibility of internal helper method ([fc6e1e7](https://github.com/turbopuffer/turbopuffer-ruby/commit/fc6e1e7c7a5824c751d32bb3f88ab8c716f763cf))
|
16
|
+
|
3
17
|
## 0.2.3 (2025-07-29)
|
4
18
|
|
5
19
|
Full Changelog: [v0.2.2...v0.2.3](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.2...v0.2.3)
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
17
17
|
<!-- x-release-please-start-version -->
|
18
18
|
|
19
19
|
```ruby
|
20
|
-
gem "turbopuffer-ruby", "~> 0.2.
|
20
|
+
gem "turbopuffer-ruby", "~> 0.2.4"
|
21
21
|
```
|
22
22
|
|
23
23
|
<!-- x-release-please-end -->
|
@@ -259,25 +259,25 @@ turbopuffer.namespace("products").write(**params)
|
|
259
259
|
Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
|
260
260
|
|
261
261
|
```ruby
|
262
|
-
# :
|
263
|
-
puts(Turbopuffer::
|
262
|
+
# :cosine_distance
|
263
|
+
puts(Turbopuffer::DistanceMetric::COSINE_DISTANCE)
|
264
264
|
|
265
|
-
# Revealed type: `T.all(Turbopuffer::
|
266
|
-
T.reveal_type(Turbopuffer::
|
265
|
+
# Revealed type: `T.all(Turbopuffer::DistanceMetric, Symbol)`
|
266
|
+
T.reveal_type(Turbopuffer::DistanceMetric::COSINE_DISTANCE)
|
267
267
|
```
|
268
268
|
|
269
269
|
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
|
270
270
|
|
271
271
|
```ruby
|
272
272
|
# Using the enum constants preserves the tagged type information:
|
273
|
-
turbopuffer.namespaces.
|
274
|
-
|
273
|
+
turbopuffer.namespaces.explain_query(
|
274
|
+
distance_metric: Turbopuffer::DistanceMetric::COSINE_DISTANCE,
|
275
275
|
# …
|
276
276
|
)
|
277
277
|
|
278
278
|
# Literal values are also permissible:
|
279
|
-
turbopuffer.namespaces.
|
280
|
-
|
279
|
+
turbopuffer.namespaces.explain_query(
|
280
|
+
distance_metric: :cosine_distance,
|
281
281
|
# …
|
282
282
|
)
|
283
283
|
```
|
@@ -365,7 +365,7 @@ module Turbopuffer
|
|
365
365
|
#
|
366
366
|
# @raise [Turbopuffer::Errors::APIError]
|
367
367
|
# @return [Array(Integer, Net::HTTPResponse, Enumerable<String>)]
|
368
|
-
|
368
|
+
def send_request(request, redirect_count:, retry_count:, send_retry_header:)
|
369
369
|
url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout)
|
370
370
|
input = {**request.except(:timeout), deadline: Turbopuffer::Internal::Util.monotonic_secs + timeout}
|
371
371
|
|
@@ -28,6 +28,14 @@ module Turbopuffer
|
|
28
28
|
# @return [Symbol, Turbopuffer::Models::Language, nil]
|
29
29
|
optional :language, enum: -> { Turbopuffer::Language }
|
30
30
|
|
31
|
+
# @!attribute max_token_length
|
32
|
+
# Maximum length of a token in bytes. Tokens larger than this value during
|
33
|
+
# tokenization will be filtered out. Has to be between `1` and `254` (inclusive).
|
34
|
+
# Defaults to `39`.
|
35
|
+
#
|
36
|
+
# @return [Integer, nil]
|
37
|
+
optional :max_token_length, Integer
|
38
|
+
|
31
39
|
# @!attribute remove_stopwords
|
32
40
|
# Removes common words from the text based on language. Defaults to `true` (i.e.
|
33
41
|
# remove common words).
|
@@ -48,7 +56,7 @@ module Turbopuffer
|
|
48
56
|
# @return [Symbol, Turbopuffer::Models::Tokenizer, nil]
|
49
57
|
optional :tokenizer, enum: -> { Turbopuffer::Tokenizer }
|
50
58
|
|
51
|
-
# @!method initialize(b: nil, case_sensitive: nil, k1: nil, language: nil, remove_stopwords: nil, stemming: nil, tokenizer: nil)
|
59
|
+
# @!method initialize(b: nil, case_sensitive: nil, k1: nil, language: nil, max_token_length: nil, remove_stopwords: nil, stemming: nil, tokenizer: nil)
|
52
60
|
# Some parameter documentations has been truncated, see
|
53
61
|
# {Turbopuffer::Models::FullTextSearchConfig} for more details.
|
54
62
|
#
|
@@ -62,6 +70,8 @@ module Turbopuffer
|
|
62
70
|
#
|
63
71
|
# @param language [Symbol, Turbopuffer::Models::Language] Describes the language of a text attribute. Defaults to `english`.
|
64
72
|
#
|
73
|
+
# @param max_token_length [Integer] Maximum length of a token in bytes. Tokens larger than this value during tokeniz
|
74
|
+
#
|
65
75
|
# @param remove_stopwords [Boolean] Removes common words from the text based on language. Defaults to `true` (i.e. r
|
66
76
|
#
|
67
77
|
# @param stemming [Boolean] Language-specific stemming for the text. Defaults to `false` (i.e., do not stem)
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
# @see Turbopuffer::Resources::Namespaces#explain_query
|
6
|
+
class NamespaceExplainQueryParams < Turbopuffer::Internal::Type::BaseModel
|
7
|
+
extend Turbopuffer::Internal::Type::RequestParameters::Converter
|
8
|
+
include Turbopuffer::Internal::Type::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute namespace
|
11
|
+
#
|
12
|
+
# @return [String, nil]
|
13
|
+
optional :namespace, String
|
14
|
+
|
15
|
+
# @!attribute aggregate_by
|
16
|
+
# Aggregations to compute over all documents in the namespace that match the
|
17
|
+
# filters.
|
18
|
+
#
|
19
|
+
# @return [Hash{Symbol=>Object}, nil]
|
20
|
+
optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
21
|
+
|
22
|
+
# @!attribute consistency
|
23
|
+
# The consistency level for a query.
|
24
|
+
#
|
25
|
+
# @return [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency, nil]
|
26
|
+
optional :consistency, -> { Turbopuffer::NamespaceExplainQueryParams::Consistency }
|
27
|
+
|
28
|
+
# @!attribute distance_metric
|
29
|
+
# A function used to calculate vector similarity.
|
30
|
+
#
|
31
|
+
# @return [Symbol, Turbopuffer::Models::DistanceMetric, nil]
|
32
|
+
optional :distance_metric, enum: -> { Turbopuffer::DistanceMetric }
|
33
|
+
|
34
|
+
# @!attribute exclude_attributes
|
35
|
+
# List of attribute names to exclude from the response. All other attributes will
|
36
|
+
# be included in the response.
|
37
|
+
#
|
38
|
+
# @return [Array<String>, nil]
|
39
|
+
optional :exclude_attributes, Turbopuffer::Internal::Type::ArrayOf[String]
|
40
|
+
|
41
|
+
# @!attribute filters
|
42
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
43
|
+
# WHERE clause.
|
44
|
+
#
|
45
|
+
# @return [Object, nil]
|
46
|
+
optional :filters, Turbopuffer::Internal::Type::Unknown
|
47
|
+
|
48
|
+
# @!attribute include_attributes
|
49
|
+
# Whether to include attributes in the response.
|
50
|
+
#
|
51
|
+
# @return [Boolean, Array<String>, nil]
|
52
|
+
optional :include_attributes, union: -> { Turbopuffer::IncludeAttributes }
|
53
|
+
|
54
|
+
# @!attribute rank_by
|
55
|
+
# How to rank the documents in the namespace.
|
56
|
+
#
|
57
|
+
# @return [Object, nil]
|
58
|
+
optional :rank_by, Turbopuffer::Internal::Type::Unknown
|
59
|
+
|
60
|
+
# @!attribute top_k
|
61
|
+
# The number of results to return.
|
62
|
+
#
|
63
|
+
# @return [Integer, nil]
|
64
|
+
optional :top_k, Integer
|
65
|
+
|
66
|
+
# @!attribute vector_encoding
|
67
|
+
# The encoding to use for vectors in the response.
|
68
|
+
#
|
69
|
+
# @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
|
70
|
+
optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
|
71
|
+
|
72
|
+
# @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
73
|
+
# Some parameter documentations has been truncated, see
|
74
|
+
# {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
|
75
|
+
#
|
76
|
+
# @param namespace [String]
|
77
|
+
#
|
78
|
+
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
79
|
+
#
|
80
|
+
# @param consistency [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency] The consistency level for a query.
|
81
|
+
#
|
82
|
+
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
83
|
+
#
|
84
|
+
# @param exclude_attributes [Array<String>] List of attribute names to exclude from the response. All other attributes will
|
85
|
+
#
|
86
|
+
# @param filters [Object] Exact filters for attributes to refine search results for. Think of it as a SQL
|
87
|
+
#
|
88
|
+
# @param include_attributes [Boolean, Array<String>] Whether to include attributes in the response.
|
89
|
+
#
|
90
|
+
# @param rank_by [Object] How to rank the documents in the namespace.
|
91
|
+
#
|
92
|
+
# @param top_k [Integer] The number of results to return.
|
93
|
+
#
|
94
|
+
# @param vector_encoding [Symbol, Turbopuffer::Models::VectorEncoding] The encoding to use for vectors in the response.
|
95
|
+
#
|
96
|
+
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
|
97
|
+
|
98
|
+
class Consistency < Turbopuffer::Internal::Type::BaseModel
|
99
|
+
# @!attribute level
|
100
|
+
# The query's consistency level.
|
101
|
+
#
|
102
|
+
# @return [Symbol, Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::Level, nil]
|
103
|
+
optional :level, enum: -> { Turbopuffer::NamespaceExplainQueryParams::Consistency::Level }
|
104
|
+
|
105
|
+
# @!method initialize(level: nil)
|
106
|
+
# The consistency level for a query.
|
107
|
+
#
|
108
|
+
# @param level [Symbol, Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::Level] The query's consistency level.
|
109
|
+
|
110
|
+
# The query's consistency level.
|
111
|
+
#
|
112
|
+
# @see Turbopuffer::Models::NamespaceExplainQueryParams::Consistency#level
|
113
|
+
module Level
|
114
|
+
extend Turbopuffer::Internal::Type::Enum
|
115
|
+
|
116
|
+
# Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
|
117
|
+
STRONG = :strong
|
118
|
+
|
119
|
+
# Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
|
120
|
+
EVENTUAL = :eventual
|
121
|
+
|
122
|
+
# @!method self.values
|
123
|
+
# @return [Array<Symbol>]
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
# @see Turbopuffer::Resources::Namespaces#explain_query
|
6
|
+
class NamespaceExplainQueryResponse < Turbopuffer::Internal::Type::BaseModel
|
7
|
+
# @!attribute plan_text
|
8
|
+
# The textual representation of the query plan.
|
9
|
+
#
|
10
|
+
# @return [String, nil]
|
11
|
+
optional :plan_text, String
|
12
|
+
|
13
|
+
# @!method initialize(plan_text: nil)
|
14
|
+
# The response to a successful query explain.
|
15
|
+
#
|
16
|
+
# @param plan_text [String] The textual representation of the query plan.
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/turbopuffer/models.rb
CHANGED
@@ -63,6 +63,8 @@ module Turbopuffer
|
|
63
63
|
|
64
64
|
NamespaceDeleteAllParams = Turbopuffer::Models::NamespaceDeleteAllParams
|
65
65
|
|
66
|
+
NamespaceExplainQueryParams = Turbopuffer::Models::NamespaceExplainQueryParams
|
67
|
+
|
66
68
|
NamespaceHintCacheWarmParams = Turbopuffer::Models::NamespaceHintCacheWarmParams
|
67
69
|
|
68
70
|
NamespaceMetadata = Turbopuffer::Models::NamespaceMetadata
|
@@ -28,6 +28,53 @@ module Turbopuffer
|
|
28
28
|
)
|
29
29
|
end
|
30
30
|
|
31
|
+
# Some parameter documentations has been truncated, see
|
32
|
+
# {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
|
33
|
+
#
|
34
|
+
# Explain a query plan.
|
35
|
+
#
|
36
|
+
# @overload explain_query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
37
|
+
#
|
38
|
+
# @param namespace [String] Path param: The name of the namespace.
|
39
|
+
#
|
40
|
+
# @param aggregate_by [Hash{Symbol=>Object}] Body param: Aggregations to compute over all documents in the namespace that mat
|
41
|
+
#
|
42
|
+
# @param consistency [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency] Body param: The consistency level for a query.
|
43
|
+
#
|
44
|
+
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] Body param: A function used to calculate vector similarity.
|
45
|
+
#
|
46
|
+
# @param exclude_attributes [Array<String>] Body param: List of attribute names to exclude from the response. All other attr
|
47
|
+
#
|
48
|
+
# @param filters [Object] Body param: Exact filters for attributes to refine search results for. Think of
|
49
|
+
#
|
50
|
+
# @param include_attributes [Boolean, Array<String>] Body param: Whether to include attributes in the response.
|
51
|
+
#
|
52
|
+
# @param rank_by [Object] Body param: How to rank the documents in the namespace.
|
53
|
+
#
|
54
|
+
# @param top_k [Integer] Body param: The number of results to return.
|
55
|
+
#
|
56
|
+
# @param vector_encoding [Symbol, Turbopuffer::Models::VectorEncoding] Body param: The encoding to use for vectors in the response.
|
57
|
+
#
|
58
|
+
# @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}, nil]
|
59
|
+
#
|
60
|
+
# @return [Turbopuffer::Models::NamespaceExplainQueryResponse]
|
61
|
+
#
|
62
|
+
# @see Turbopuffer::Models::NamespaceExplainQueryParams
|
63
|
+
def explain_query(params = {})
|
64
|
+
parsed, options = Turbopuffer::NamespaceExplainQueryParams.dump_request(params)
|
65
|
+
namespace =
|
66
|
+
parsed.delete(:namespace) do
|
67
|
+
@client.default_namespace
|
68
|
+
end
|
69
|
+
@client.request(
|
70
|
+
method: :post,
|
71
|
+
path: ["v2/namespaces/%1$s/explain_query", namespace],
|
72
|
+
body: parsed,
|
73
|
+
model: Turbopuffer::Models::NamespaceExplainQueryResponse,
|
74
|
+
options: options
|
75
|
+
)
|
76
|
+
end
|
77
|
+
|
31
78
|
# Warm the cache for a namespace.
|
32
79
|
#
|
33
80
|
# @overload hint_cache_warm(namespace: nil, request_options: {})
|
data/lib/turbopuffer/version.rb
CHANGED
data/lib/turbopuffer.rb
CHANGED
@@ -64,6 +64,8 @@ require_relative "turbopuffer/models/include_attributes"
|
|
64
64
|
require_relative "turbopuffer/models/language"
|
65
65
|
require_relative "turbopuffer/models/namespace_delete_all_params"
|
66
66
|
require_relative "turbopuffer/models/namespace_delete_all_response"
|
67
|
+
require_relative "turbopuffer/models/namespace_explain_query_params"
|
68
|
+
require_relative "turbopuffer/models/namespace_explain_query_response"
|
67
69
|
require_relative "turbopuffer/models/namespace_hint_cache_warm_params"
|
68
70
|
require_relative "turbopuffer/models/namespace_hint_cache_warm_response"
|
69
71
|
require_relative "turbopuffer/models/namespace_metadata"
|
@@ -40,6 +40,15 @@ module Turbopuffer
|
|
40
40
|
sig { params(language: Turbopuffer::Language::OrSymbol).void }
|
41
41
|
attr_writer :language
|
42
42
|
|
43
|
+
# Maximum length of a token in bytes. Tokens larger than this value during
|
44
|
+
# tokenization will be filtered out. Has to be between `1` and `254` (inclusive).
|
45
|
+
# Defaults to `39`.
|
46
|
+
sig { returns(T.nilable(Integer)) }
|
47
|
+
attr_reader :max_token_length
|
48
|
+
|
49
|
+
sig { params(max_token_length: Integer).void }
|
50
|
+
attr_writer :max_token_length
|
51
|
+
|
43
52
|
# Removes common words from the text based on language. Defaults to `true` (i.e.
|
44
53
|
# remove common words).
|
45
54
|
sig { returns(T.nilable(T::Boolean)) }
|
@@ -70,6 +79,7 @@ module Turbopuffer
|
|
70
79
|
case_sensitive: T::Boolean,
|
71
80
|
k1: Float,
|
72
81
|
language: Turbopuffer::Language::OrSymbol,
|
82
|
+
max_token_length: Integer,
|
73
83
|
remove_stopwords: T::Boolean,
|
74
84
|
stemming: T::Boolean,
|
75
85
|
tokenizer: Turbopuffer::Tokenizer::OrSymbol
|
@@ -85,6 +95,10 @@ module Turbopuffer
|
|
85
95
|
k1: nil,
|
86
96
|
# Describes the language of a text attribute. Defaults to `english`.
|
87
97
|
language: nil,
|
98
|
+
# Maximum length of a token in bytes. Tokens larger than this value during
|
99
|
+
# tokenization will be filtered out. Has to be between `1` and `254` (inclusive).
|
100
|
+
# Defaults to `39`.
|
101
|
+
max_token_length: nil,
|
88
102
|
# Removes common words from the text based on language. Defaults to `true` (i.e.
|
89
103
|
# remove common words).
|
90
104
|
remove_stopwords: nil,
|
@@ -103,6 +117,7 @@ module Turbopuffer
|
|
103
117
|
case_sensitive: T::Boolean,
|
104
118
|
k1: Float,
|
105
119
|
language: Turbopuffer::Language::OrSymbol,
|
120
|
+
max_token_length: Integer,
|
106
121
|
remove_stopwords: T::Boolean,
|
107
122
|
stemming: T::Boolean,
|
108
123
|
tokenizer: Turbopuffer::Tokenizer::OrSymbol
|
@@ -0,0 +1,260 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceExplainQueryParams < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
extend Turbopuffer::Internal::Type::RequestParameters::Converter
|
7
|
+
include Turbopuffer::Internal::Type::RequestParameters
|
8
|
+
|
9
|
+
OrHash =
|
10
|
+
T.type_alias do
|
11
|
+
T.any(
|
12
|
+
Turbopuffer::NamespaceExplainQueryParams,
|
13
|
+
Turbopuffer::Internal::AnyHash
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
sig { returns(T.nilable(String)) }
|
18
|
+
attr_reader :namespace
|
19
|
+
|
20
|
+
sig { params(namespace: String).void }
|
21
|
+
attr_writer :namespace
|
22
|
+
|
23
|
+
# Aggregations to compute over all documents in the namespace that match the
|
24
|
+
# filters.
|
25
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
26
|
+
attr_reader :aggregate_by
|
27
|
+
|
28
|
+
sig { params(aggregate_by: T::Hash[Symbol, T.anything]).void }
|
29
|
+
attr_writer :aggregate_by
|
30
|
+
|
31
|
+
# The consistency level for a query.
|
32
|
+
sig do
|
33
|
+
returns(
|
34
|
+
T.nilable(Turbopuffer::NamespaceExplainQueryParams::Consistency)
|
35
|
+
)
|
36
|
+
end
|
37
|
+
attr_reader :consistency
|
38
|
+
|
39
|
+
sig do
|
40
|
+
params(
|
41
|
+
consistency:
|
42
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::OrHash
|
43
|
+
).void
|
44
|
+
end
|
45
|
+
attr_writer :consistency
|
46
|
+
|
47
|
+
# A function used to calculate vector similarity.
|
48
|
+
sig { returns(T.nilable(Turbopuffer::DistanceMetric::OrSymbol)) }
|
49
|
+
attr_reader :distance_metric
|
50
|
+
|
51
|
+
sig do
|
52
|
+
params(distance_metric: Turbopuffer::DistanceMetric::OrSymbol).void
|
53
|
+
end
|
54
|
+
attr_writer :distance_metric
|
55
|
+
|
56
|
+
# List of attribute names to exclude from the response. All other attributes will
|
57
|
+
# be included in the response.
|
58
|
+
sig { returns(T.nilable(T::Array[String])) }
|
59
|
+
attr_reader :exclude_attributes
|
60
|
+
|
61
|
+
sig { params(exclude_attributes: T::Array[String]).void }
|
62
|
+
attr_writer :exclude_attributes
|
63
|
+
|
64
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
65
|
+
# WHERE clause.
|
66
|
+
sig { returns(T.nilable(T.anything)) }
|
67
|
+
attr_reader :filters
|
68
|
+
|
69
|
+
sig { params(filters: T.anything).void }
|
70
|
+
attr_writer :filters
|
71
|
+
|
72
|
+
# Whether to include attributes in the response.
|
73
|
+
sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
|
74
|
+
attr_reader :include_attributes
|
75
|
+
|
76
|
+
sig do
|
77
|
+
params(
|
78
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants
|
79
|
+
).void
|
80
|
+
end
|
81
|
+
attr_writer :include_attributes
|
82
|
+
|
83
|
+
# How to rank the documents in the namespace.
|
84
|
+
sig { returns(T.nilable(T.anything)) }
|
85
|
+
attr_reader :rank_by
|
86
|
+
|
87
|
+
sig { params(rank_by: T.anything).void }
|
88
|
+
attr_writer :rank_by
|
89
|
+
|
90
|
+
# The number of results to return.
|
91
|
+
sig { returns(T.nilable(Integer)) }
|
92
|
+
attr_reader :top_k
|
93
|
+
|
94
|
+
sig { params(top_k: Integer).void }
|
95
|
+
attr_writer :top_k
|
96
|
+
|
97
|
+
# The encoding to use for vectors in the response.
|
98
|
+
sig { returns(T.nilable(Turbopuffer::VectorEncoding::OrSymbol)) }
|
99
|
+
attr_reader :vector_encoding
|
100
|
+
|
101
|
+
sig do
|
102
|
+
params(vector_encoding: Turbopuffer::VectorEncoding::OrSymbol).void
|
103
|
+
end
|
104
|
+
attr_writer :vector_encoding
|
105
|
+
|
106
|
+
sig do
|
107
|
+
params(
|
108
|
+
namespace: String,
|
109
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
110
|
+
consistency:
|
111
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::OrHash,
|
112
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
113
|
+
exclude_attributes: T::Array[String],
|
114
|
+
filters: T.anything,
|
115
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
116
|
+
rank_by: T.anything,
|
117
|
+
top_k: Integer,
|
118
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
119
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
120
|
+
).returns(T.attached_class)
|
121
|
+
end
|
122
|
+
def self.new(
|
123
|
+
namespace: nil,
|
124
|
+
# Aggregations to compute over all documents in the namespace that match the
|
125
|
+
# filters.
|
126
|
+
aggregate_by: nil,
|
127
|
+
# The consistency level for a query.
|
128
|
+
consistency: nil,
|
129
|
+
# A function used to calculate vector similarity.
|
130
|
+
distance_metric: nil,
|
131
|
+
# List of attribute names to exclude from the response. All other attributes will
|
132
|
+
# be included in the response.
|
133
|
+
exclude_attributes: nil,
|
134
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
135
|
+
# WHERE clause.
|
136
|
+
filters: nil,
|
137
|
+
# Whether to include attributes in the response.
|
138
|
+
include_attributes: nil,
|
139
|
+
# How to rank the documents in the namespace.
|
140
|
+
rank_by: nil,
|
141
|
+
# The number of results to return.
|
142
|
+
top_k: nil,
|
143
|
+
# The encoding to use for vectors in the response.
|
144
|
+
vector_encoding: nil,
|
145
|
+
request_options: {}
|
146
|
+
)
|
147
|
+
end
|
148
|
+
|
149
|
+
sig do
|
150
|
+
override.returns(
|
151
|
+
{
|
152
|
+
namespace: String,
|
153
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
154
|
+
consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
155
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
156
|
+
exclude_attributes: T::Array[String],
|
157
|
+
filters: T.anything,
|
158
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
159
|
+
rank_by: T.anything,
|
160
|
+
top_k: Integer,
|
161
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
162
|
+
request_options: Turbopuffer::RequestOptions
|
163
|
+
}
|
164
|
+
)
|
165
|
+
end
|
166
|
+
def to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
class Consistency < Turbopuffer::Internal::Type::BaseModel
|
170
|
+
OrHash =
|
171
|
+
T.type_alias do
|
172
|
+
T.any(
|
173
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
174
|
+
Turbopuffer::Internal::AnyHash
|
175
|
+
)
|
176
|
+
end
|
177
|
+
|
178
|
+
# The query's consistency level.
|
179
|
+
sig do
|
180
|
+
returns(
|
181
|
+
T.nilable(
|
182
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
183
|
+
)
|
184
|
+
)
|
185
|
+
end
|
186
|
+
attr_reader :level
|
187
|
+
|
188
|
+
sig do
|
189
|
+
params(
|
190
|
+
level:
|
191
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
192
|
+
).void
|
193
|
+
end
|
194
|
+
attr_writer :level
|
195
|
+
|
196
|
+
# The consistency level for a query.
|
197
|
+
sig do
|
198
|
+
params(
|
199
|
+
level:
|
200
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
201
|
+
).returns(T.attached_class)
|
202
|
+
end
|
203
|
+
def self.new(
|
204
|
+
# The query's consistency level.
|
205
|
+
level: nil
|
206
|
+
)
|
207
|
+
end
|
208
|
+
|
209
|
+
sig do
|
210
|
+
override.returns(
|
211
|
+
{
|
212
|
+
level:
|
213
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
214
|
+
}
|
215
|
+
)
|
216
|
+
end
|
217
|
+
def to_hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# The query's consistency level.
|
221
|
+
module Level
|
222
|
+
extend Turbopuffer::Internal::Type::Enum
|
223
|
+
|
224
|
+
TaggedSymbol =
|
225
|
+
T.type_alias do
|
226
|
+
T.all(
|
227
|
+
Symbol,
|
228
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level
|
229
|
+
)
|
230
|
+
end
|
231
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
232
|
+
|
233
|
+
# Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
|
234
|
+
STRONG =
|
235
|
+
T.let(
|
236
|
+
:strong,
|
237
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
238
|
+
)
|
239
|
+
|
240
|
+
# Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
|
241
|
+
EVENTUAL =
|
242
|
+
T.let(
|
243
|
+
:eventual,
|
244
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
245
|
+
)
|
246
|
+
|
247
|
+
sig do
|
248
|
+
override.returns(
|
249
|
+
T::Array[
|
250
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
251
|
+
]
|
252
|
+
)
|
253
|
+
end
|
254
|
+
def self.values
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceExplainQueryResponse < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Turbopuffer::Models::NamespaceExplainQueryResponse,
|
10
|
+
Turbopuffer::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# The textual representation of the query plan.
|
15
|
+
sig { returns(T.nilable(String)) }
|
16
|
+
attr_reader :plan_text
|
17
|
+
|
18
|
+
sig { params(plan_text: String).void }
|
19
|
+
attr_writer :plan_text
|
20
|
+
|
21
|
+
# The response to a successful query explain.
|
22
|
+
sig { params(plan_text: String).returns(T.attached_class) }
|
23
|
+
def self.new(
|
24
|
+
# The textual representation of the query plan.
|
25
|
+
plan_text: nil
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
sig { override.returns({ plan_text: String }) }
|
30
|
+
def to_hash
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/rbi/turbopuffer/models.rbi
CHANGED
@@ -25,6 +25,8 @@ module Turbopuffer
|
|
25
25
|
|
26
26
|
NamespaceDeleteAllParams = Turbopuffer::Models::NamespaceDeleteAllParams
|
27
27
|
|
28
|
+
NamespaceExplainQueryParams = Turbopuffer::Models::NamespaceExplainQueryParams
|
29
|
+
|
28
30
|
NamespaceHintCacheWarmParams =
|
29
31
|
Turbopuffer::Models::NamespaceHintCacheWarmParams
|
30
32
|
|
@@ -17,6 +17,51 @@ module Turbopuffer
|
|
17
17
|
)
|
18
18
|
end
|
19
19
|
|
20
|
+
# Explain a query plan.
|
21
|
+
sig do
|
22
|
+
params(
|
23
|
+
namespace: String,
|
24
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
25
|
+
consistency:
|
26
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::OrHash,
|
27
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
28
|
+
exclude_attributes: T::Array[String],
|
29
|
+
filters: T.anything,
|
30
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
31
|
+
rank_by: T.anything,
|
32
|
+
top_k: Integer,
|
33
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
34
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
35
|
+
).returns(Turbopuffer::Models::NamespaceExplainQueryResponse)
|
36
|
+
end
|
37
|
+
def explain_query(
|
38
|
+
# Path param: The name of the namespace.
|
39
|
+
namespace: nil,
|
40
|
+
# Body param: Aggregations to compute over all documents in the namespace that
|
41
|
+
# match the filters.
|
42
|
+
aggregate_by: nil,
|
43
|
+
# Body param: The consistency level for a query.
|
44
|
+
consistency: nil,
|
45
|
+
# Body param: A function used to calculate vector similarity.
|
46
|
+
distance_metric: nil,
|
47
|
+
# Body param: List of attribute names to exclude from the response. All other
|
48
|
+
# attributes will be included in the response.
|
49
|
+
exclude_attributes: nil,
|
50
|
+
# Body param: Exact filters for attributes to refine search results for. Think of
|
51
|
+
# it as a SQL WHERE clause.
|
52
|
+
filters: nil,
|
53
|
+
# Body param: Whether to include attributes in the response.
|
54
|
+
include_attributes: nil,
|
55
|
+
# Body param: How to rank the documents in the namespace.
|
56
|
+
rank_by: nil,
|
57
|
+
# Body param: The number of results to return.
|
58
|
+
top_k: nil,
|
59
|
+
# Body param: The encoding to use for vectors in the response.
|
60
|
+
vector_encoding: nil,
|
61
|
+
request_options: {}
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
20
65
|
# Warm the cache for a namespace.
|
21
66
|
sig do
|
22
67
|
params(
|
@@ -6,6 +6,7 @@ module Turbopuffer
|
|
6
6
|
case_sensitive: bool,
|
7
7
|
:k1 => Float,
|
8
8
|
language: Turbopuffer::Models::language,
|
9
|
+
max_token_length: Integer,
|
9
10
|
remove_stopwords: bool,
|
10
11
|
stemming: bool,
|
11
12
|
tokenizer: Turbopuffer::Models::tokenizer
|
@@ -30,6 +31,10 @@ module Turbopuffer
|
|
30
31
|
Turbopuffer::Models::language
|
31
32
|
) -> Turbopuffer::Models::language
|
32
33
|
|
34
|
+
attr_reader max_token_length: Integer?
|
35
|
+
|
36
|
+
def max_token_length=: (Integer) -> Integer
|
37
|
+
|
33
38
|
attr_reader remove_stopwords: bool?
|
34
39
|
|
35
40
|
def remove_stopwords=: (bool) -> bool
|
@@ -49,6 +54,7 @@ module Turbopuffer
|
|
49
54
|
?case_sensitive: bool,
|
50
55
|
?k1: Float,
|
51
56
|
?language: Turbopuffer::Models::language,
|
57
|
+
?max_token_length: Integer,
|
52
58
|
?remove_stopwords: bool,
|
53
59
|
?stemming: bool,
|
54
60
|
?tokenizer: Turbopuffer::Models::tokenizer
|
@@ -59,6 +65,7 @@ module Turbopuffer
|
|
59
65
|
case_sensitive: bool,
|
60
66
|
:k1 => Float,
|
61
67
|
language: Turbopuffer::Models::language,
|
68
|
+
max_token_length: Integer,
|
62
69
|
remove_stopwords: bool,
|
63
70
|
stemming: bool,
|
64
71
|
tokenizer: Turbopuffer::Models::tokenizer
|
@@ -0,0 +1,134 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type namespace_explain_query_params =
|
4
|
+
{
|
5
|
+
namespace: String,
|
6
|
+
aggregate_by: ::Hash[Symbol, top],
|
7
|
+
consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
8
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
9
|
+
exclude_attributes: ::Array[String],
|
10
|
+
filters: top,
|
11
|
+
include_attributes: Turbopuffer::Models::include_attributes,
|
12
|
+
rank_by: top,
|
13
|
+
top_k: Integer,
|
14
|
+
vector_encoding: Turbopuffer::Models::vector_encoding
|
15
|
+
}
|
16
|
+
& Turbopuffer::Internal::Type::request_parameters
|
17
|
+
|
18
|
+
class NamespaceExplainQueryParams < Turbopuffer::Internal::Type::BaseModel
|
19
|
+
extend Turbopuffer::Internal::Type::RequestParameters::Converter
|
20
|
+
include Turbopuffer::Internal::Type::RequestParameters
|
21
|
+
|
22
|
+
attr_reader namespace: String?
|
23
|
+
|
24
|
+
def namespace=: (String) -> String
|
25
|
+
|
26
|
+
attr_reader aggregate_by: ::Hash[Symbol, top]?
|
27
|
+
|
28
|
+
def aggregate_by=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
29
|
+
|
30
|
+
attr_reader consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency?
|
31
|
+
|
32
|
+
def consistency=: (
|
33
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency
|
34
|
+
) -> Turbopuffer::NamespaceExplainQueryParams::Consistency
|
35
|
+
|
36
|
+
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
37
|
+
|
38
|
+
def distance_metric=: (
|
39
|
+
Turbopuffer::Models::distance_metric
|
40
|
+
) -> Turbopuffer::Models::distance_metric
|
41
|
+
|
42
|
+
attr_reader exclude_attributes: ::Array[String]?
|
43
|
+
|
44
|
+
def exclude_attributes=: (::Array[String]) -> ::Array[String]
|
45
|
+
|
46
|
+
attr_reader filters: top?
|
47
|
+
|
48
|
+
def filters=: (top) -> top
|
49
|
+
|
50
|
+
attr_reader include_attributes: Turbopuffer::Models::include_attributes?
|
51
|
+
|
52
|
+
def include_attributes=: (
|
53
|
+
Turbopuffer::Models::include_attributes
|
54
|
+
) -> Turbopuffer::Models::include_attributes
|
55
|
+
|
56
|
+
attr_reader rank_by: top?
|
57
|
+
|
58
|
+
def rank_by=: (top) -> top
|
59
|
+
|
60
|
+
attr_reader top_k: Integer?
|
61
|
+
|
62
|
+
def top_k=: (Integer) -> Integer
|
63
|
+
|
64
|
+
attr_reader vector_encoding: Turbopuffer::Models::vector_encoding?
|
65
|
+
|
66
|
+
def vector_encoding=: (
|
67
|
+
Turbopuffer::Models::vector_encoding
|
68
|
+
) -> Turbopuffer::Models::vector_encoding
|
69
|
+
|
70
|
+
def initialize: (
|
71
|
+
?namespace: String,
|
72
|
+
?aggregate_by: ::Hash[Symbol, top],
|
73
|
+
?consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
74
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
75
|
+
?exclude_attributes: ::Array[String],
|
76
|
+
?filters: top,
|
77
|
+
?include_attributes: Turbopuffer::Models::include_attributes,
|
78
|
+
?rank_by: top,
|
79
|
+
?top_k: Integer,
|
80
|
+
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
81
|
+
?request_options: Turbopuffer::request_opts
|
82
|
+
) -> void
|
83
|
+
|
84
|
+
def to_hash: -> {
|
85
|
+
namespace: String,
|
86
|
+
aggregate_by: ::Hash[Symbol, top],
|
87
|
+
consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
88
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
89
|
+
exclude_attributes: ::Array[String],
|
90
|
+
filters: top,
|
91
|
+
include_attributes: Turbopuffer::Models::include_attributes,
|
92
|
+
rank_by: top,
|
93
|
+
top_k: Integer,
|
94
|
+
vector_encoding: Turbopuffer::Models::vector_encoding,
|
95
|
+
request_options: Turbopuffer::RequestOptions
|
96
|
+
}
|
97
|
+
|
98
|
+
type consistency =
|
99
|
+
{
|
100
|
+
level: Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level
|
101
|
+
}
|
102
|
+
|
103
|
+
class Consistency < Turbopuffer::Internal::Type::BaseModel
|
104
|
+
attr_reader level: Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level?
|
105
|
+
|
106
|
+
def level=: (
|
107
|
+
Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level
|
108
|
+
) -> Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level
|
109
|
+
|
110
|
+
def initialize: (
|
111
|
+
?level: Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level
|
112
|
+
) -> void
|
113
|
+
|
114
|
+
def to_hash: -> {
|
115
|
+
level: Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level
|
116
|
+
}
|
117
|
+
|
118
|
+
type level = :strong | :eventual
|
119
|
+
|
120
|
+
module Level
|
121
|
+
extend Turbopuffer::Internal::Type::Enum
|
122
|
+
|
123
|
+
# Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
|
124
|
+
STRONG: :strong
|
125
|
+
|
126
|
+
# Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
|
127
|
+
EVENTUAL: :eventual
|
128
|
+
|
129
|
+
def self?.values: -> ::Array[Turbopuffer::Models::NamespaceExplainQueryParams::Consistency::level]
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type namespace_explain_query_response = { plan_text: String }
|
4
|
+
|
5
|
+
class NamespaceExplainQueryResponse < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
attr_reader plan_text: String?
|
7
|
+
|
8
|
+
def plan_text=: (String) -> String
|
9
|
+
|
10
|
+
def initialize: (?plan_text: String) -> void
|
11
|
+
|
12
|
+
def to_hash: -> { plan_text: String }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/sig/turbopuffer/models.rbs
CHANGED
@@ -23,6 +23,8 @@ module Turbopuffer
|
|
23
23
|
|
24
24
|
class NamespaceDeleteAllParams = Turbopuffer::Models::NamespaceDeleteAllParams
|
25
25
|
|
26
|
+
class NamespaceExplainQueryParams = Turbopuffer::Models::NamespaceExplainQueryParams
|
27
|
+
|
26
28
|
class NamespaceHintCacheWarmParams = Turbopuffer::Models::NamespaceHintCacheWarmParams
|
27
29
|
|
28
30
|
class NamespaceMetadata = Turbopuffer::Models::NamespaceMetadata
|
@@ -6,6 +6,20 @@ module Turbopuffer
|
|
6
6
|
?request_options: Turbopuffer::request_opts
|
7
7
|
) -> Turbopuffer::Models::NamespaceDeleteAllResponse
|
8
8
|
|
9
|
+
def explain_query: (
|
10
|
+
?namespace: String,
|
11
|
+
?aggregate_by: ::Hash[Symbol, top],
|
12
|
+
?consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
13
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
14
|
+
?exclude_attributes: ::Array[String],
|
15
|
+
?filters: top,
|
16
|
+
?include_attributes: Turbopuffer::Models::include_attributes,
|
17
|
+
?rank_by: top,
|
18
|
+
?top_k: Integer,
|
19
|
+
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
20
|
+
?request_options: Turbopuffer::request_opts
|
21
|
+
) -> Turbopuffer::Models::NamespaceExplainQueryResponse
|
22
|
+
|
9
23
|
def hint_cache_warm: (
|
10
24
|
?namespace: String,
|
11
25
|
?request_options: Turbopuffer::request_opts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turbopuffer-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
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-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -69,6 +69,8 @@ files:
|
|
69
69
|
- lib/turbopuffer/models/language.rb
|
70
70
|
- lib/turbopuffer/models/namespace_delete_all_params.rb
|
71
71
|
- lib/turbopuffer/models/namespace_delete_all_response.rb
|
72
|
+
- lib/turbopuffer/models/namespace_explain_query_params.rb
|
73
|
+
- lib/turbopuffer/models/namespace_explain_query_response.rb
|
72
74
|
- lib/turbopuffer/models/namespace_hint_cache_warm_params.rb
|
73
75
|
- lib/turbopuffer/models/namespace_hint_cache_warm_response.rb
|
74
76
|
- lib/turbopuffer/models/namespace_metadata.rb
|
@@ -132,6 +134,8 @@ files:
|
|
132
134
|
- rbi/turbopuffer/models/language.rbi
|
133
135
|
- rbi/turbopuffer/models/namespace_delete_all_params.rbi
|
134
136
|
- rbi/turbopuffer/models/namespace_delete_all_response.rbi
|
137
|
+
- rbi/turbopuffer/models/namespace_explain_query_params.rbi
|
138
|
+
- rbi/turbopuffer/models/namespace_explain_query_response.rbi
|
135
139
|
- rbi/turbopuffer/models/namespace_hint_cache_warm_params.rbi
|
136
140
|
- rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi
|
137
141
|
- rbi/turbopuffer/models/namespace_metadata.rbi
|
@@ -194,6 +198,8 @@ files:
|
|
194
198
|
- sig/turbopuffer/models/language.rbs
|
195
199
|
- sig/turbopuffer/models/namespace_delete_all_params.rbs
|
196
200
|
- sig/turbopuffer/models/namespace_delete_all_response.rbs
|
201
|
+
- sig/turbopuffer/models/namespace_explain_query_params.rbs
|
202
|
+
- sig/turbopuffer/models/namespace_explain_query_response.rbs
|
197
203
|
- sig/turbopuffer/models/namespace_hint_cache_warm_params.rbs
|
198
204
|
- sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs
|
199
205
|
- sig/turbopuffer/models/namespace_metadata.rbs
|