turbopuffer 0.1.0 → 1.3.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/.ignore +2 -0
- data/CHANGELOG.md +218 -0
- data/README.md +270 -40
- data/SECURITY.md +27 -0
- data/lib/turbopuffer/client.rb +122 -16
- data/lib/turbopuffer/errors.rb +228 -0
- data/lib/turbopuffer/file_part.rb +55 -0
- data/lib/turbopuffer/internal/namespace_page.rb +86 -0
- data/lib/turbopuffer/internal/transport/base_client.rb +567 -0
- data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +201 -0
- data/lib/turbopuffer/internal/type/array_of.rb +168 -0
- data/lib/turbopuffer/internal/type/base_model.rb +529 -0
- data/lib/turbopuffer/internal/type/base_page.rb +55 -0
- data/lib/turbopuffer/internal/type/boolean.rb +77 -0
- data/lib/turbopuffer/internal/type/converter.rb +327 -0
- data/lib/turbopuffer/internal/type/enum.rb +152 -0
- data/lib/turbopuffer/internal/type/file_input.rb +108 -0
- data/lib/turbopuffer/internal/type/hash_of.rb +188 -0
- data/lib/turbopuffer/internal/type/request_parameters.rb +42 -0
- data/lib/turbopuffer/internal/type/union.rb +254 -0
- data/lib/turbopuffer/internal/type/unknown.rb +81 -0
- data/lib/turbopuffer/internal/util.rb +914 -0
- data/lib/turbopuffer/internal.rb +20 -0
- data/lib/turbopuffer/models/aggregation_group.rb +8 -0
- data/lib/turbopuffer/models/attribute_schema.rb +19 -0
- data/lib/turbopuffer/models/attribute_schema_config.rb +56 -0
- data/lib/turbopuffer/models/attribute_type.rb +7 -0
- data/lib/turbopuffer/models/bm25_clause_params.rb +18 -0
- data/lib/turbopuffer/models/client_namespaces_params.rb +38 -0
- data/lib/turbopuffer/models/columns.rb +64 -0
- data/lib/turbopuffer/models/contains_all_tokens_filter_params.rb +18 -0
- data/lib/turbopuffer/models/distance_metric.rb +19 -0
- data/lib/turbopuffer/models/full_text_search.rb +20 -0
- data/lib/turbopuffer/models/full_text_search_config.rb +83 -0
- data/lib/turbopuffer/models/id.rb +19 -0
- data/lib/turbopuffer/models/include_attributes.rb +22 -0
- data/lib/turbopuffer/models/language.rb +32 -0
- data/lib/turbopuffer/models/namespace_delete_all_params.rb +20 -0
- data/lib/turbopuffer/models/namespace_delete_all_response.rb +19 -0
- data/lib/turbopuffer/models/namespace_explain_query_params.rb +137 -0
- data/lib/turbopuffer/models/namespace_explain_query_response.rb +19 -0
- data/lib/turbopuffer/models/namespace_hint_cache_warm_params.rb +20 -0
- data/lib/turbopuffer/models/namespace_hint_cache_warm_response.rb +26 -0
- data/lib/turbopuffer/models/namespace_metadata.rb +43 -0
- data/lib/turbopuffer/models/namespace_metadata_params.rb +20 -0
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +73 -0
- data/lib/turbopuffer/models/namespace_multi_query_response.rb +58 -0
- data/lib/turbopuffer/models/namespace_query_params.rb +137 -0
- data/lib/turbopuffer/models/namespace_query_response.rb +49 -0
- data/lib/turbopuffer/models/namespace_recall_params.rb +66 -0
- data/lib/turbopuffer/models/namespace_recall_response.rb +68 -0
- data/lib/turbopuffer/models/namespace_schema_params.rb +20 -0
- data/lib/turbopuffer/models/namespace_schema_response.rb +8 -0
- data/lib/turbopuffer/models/namespace_summary.rb +19 -0
- data/lib/turbopuffer/models/namespace_update_schema_params.rb +29 -0
- data/lib/turbopuffer/models/namespace_update_schema_response.rb +9 -0
- data/lib/turbopuffer/models/namespace_write_params.rb +158 -0
- data/lib/turbopuffer/models/namespace_write_response.rb +67 -0
- data/lib/turbopuffer/models/query.rb +81 -0
- data/lib/turbopuffer/models/query_billing.rb +26 -0
- data/lib/turbopuffer/models/query_performance.rb +63 -0
- data/lib/turbopuffer/models/row.rb +46 -0
- data/lib/turbopuffer/models/tokenizer.rb +19 -0
- data/lib/turbopuffer/models/vector.rb +22 -0
- data/lib/turbopuffer/models/vector_encoding.rb +16 -0
- data/lib/turbopuffer/models/write_billing.rb +26 -0
- data/lib/turbopuffer/models.rb +110 -0
- data/lib/turbopuffer/namespace.rb +14 -50
- data/lib/turbopuffer/request_options.rb +77 -0
- data/lib/turbopuffer/resources/namespaces.rb +366 -0
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +94 -4
- data/manifest.yaml +15 -0
- data/rbi/turbopuffer/client.rbi +91 -0
- data/rbi/turbopuffer/errors.rbi +205 -0
- data/rbi/turbopuffer/file_part.rbi +37 -0
- data/rbi/turbopuffer/internal/namespace_page.rbi +22 -0
- data/rbi/turbopuffer/internal/transport/base_client.rbi +297 -0
- data/rbi/turbopuffer/internal/transport/pooled_net_requester.rbi +80 -0
- data/rbi/turbopuffer/internal/type/array_of.rbi +104 -0
- data/rbi/turbopuffer/internal/type/base_model.rbi +304 -0
- data/rbi/turbopuffer/internal/type/base_page.rbi +43 -0
- data/rbi/turbopuffer/internal/type/boolean.rbi +58 -0
- data/rbi/turbopuffer/internal/type/converter.rbi +216 -0
- data/rbi/turbopuffer/internal/type/enum.rbi +82 -0
- data/rbi/turbopuffer/internal/type/file_input.rbi +59 -0
- data/rbi/turbopuffer/internal/type/hash_of.rbi +104 -0
- data/rbi/turbopuffer/internal/type/request_parameters.rbi +31 -0
- data/rbi/turbopuffer/internal/type/union.rbi +128 -0
- data/rbi/turbopuffer/internal/type/unknown.rbi +58 -0
- data/rbi/turbopuffer/internal/util.rbi +487 -0
- data/rbi/turbopuffer/internal.rbi +18 -0
- data/rbi/turbopuffer/models/aggregation_group.rbi +13 -0
- data/rbi/turbopuffer/models/attribute_schema.rbi +17 -0
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +103 -0
- data/rbi/turbopuffer/models/attribute_type.rbi +7 -0
- data/rbi/turbopuffer/models/bm25_clause_params.rbi +31 -0
- data/rbi/turbopuffer/models/client_namespaces_params.rbi +71 -0
- data/rbi/turbopuffer/models/columns.rbi +82 -0
- data/rbi/turbopuffer/models/contains_all_tokens_filter_params.rbi +34 -0
- data/rbi/turbopuffer/models/distance_metric.rbi +27 -0
- data/rbi/turbopuffer/models/full_text_search.rbi +19 -0
- data/rbi/turbopuffer/models/full_text_search_config.rbi +133 -0
- data/rbi/turbopuffer/models/id.rbi +16 -0
- data/rbi/turbopuffer/models/include_attributes.rbi +24 -0
- data/rbi/turbopuffer/models/language.rbi +36 -0
- data/rbi/turbopuffer/models/namespace_delete_all_params.rbi +41 -0
- data/rbi/turbopuffer/models/namespace_delete_all_response.rbi +31 -0
- data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +273 -0
- data/rbi/turbopuffer/models/namespace_explain_query_response.rbi +34 -0
- data/rbi/turbopuffer/models/namespace_hint_cache_warm_params.rbi +41 -0
- data/rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi +38 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +62 -0
- data/rbi/turbopuffer/models/namespace_metadata_params.rbi +41 -0
- data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +175 -0
- data/rbi/turbopuffer/models/namespace_multi_query_response.rbi +121 -0
- data/rbi/turbopuffer/models/namespace_query_params.rbi +267 -0
- data/rbi/turbopuffer/models/namespace_query_response.rbi +84 -0
- data/rbi/turbopuffer/models/namespace_recall_params.rbi +106 -0
- data/rbi/turbopuffer/models/namespace_recall_response.rbi +134 -0
- data/rbi/turbopuffer/models/namespace_schema_params.rbi +41 -0
- data/rbi/turbopuffer/models/namespace_schema_response.rbi +11 -0
- data/rbi/turbopuffer/models/namespace_summary.rbi +28 -0
- data/rbi/turbopuffer/models/namespace_update_schema_params.rbi +80 -0
- data/rbi/turbopuffer/models/namespace_update_schema_response.rbi +11 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +290 -0
- data/rbi/turbopuffer/models/namespace_write_response.rbi +101 -0
- data/rbi/turbopuffer/models/query.rbi +132 -0
- data/rbi/turbopuffer/models/query_billing.rbi +46 -0
- data/rbi/turbopuffer/models/query_performance.rbi +82 -0
- data/rbi/turbopuffer/models/row.rbi +47 -0
- data/rbi/turbopuffer/models/tokenizer.rbi +24 -0
- data/rbi/turbopuffer/models/vector.rbi +22 -0
- data/rbi/turbopuffer/models/vector_encoding.rbi +22 -0
- data/rbi/turbopuffer/models/write_billing.rbi +49 -0
- data/rbi/turbopuffer/models.rbi +77 -0
- data/rbi/turbopuffer/namespace.rbi +8 -0
- data/rbi/turbopuffer/request_options.rbi +59 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +304 -0
- data/rbi/turbopuffer/version.rbi +5 -0
- data/sig/turbopuffer/client.rbs +41 -0
- data/sig/turbopuffer/errors.rbs +117 -0
- data/sig/turbopuffer/file_part.rbs +21 -0
- data/sig/turbopuffer/internal/namespace_page.rbs +13 -0
- data/sig/turbopuffer/internal/transport/base_client.rbs +131 -0
- data/sig/turbopuffer/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/turbopuffer/internal/type/array_of.rbs +48 -0
- data/sig/turbopuffer/internal/type/base_model.rbs +102 -0
- data/sig/turbopuffer/internal/type/base_page.rbs +24 -0
- data/sig/turbopuffer/internal/type/boolean.rbs +26 -0
- data/sig/turbopuffer/internal/type/converter.rbs +79 -0
- data/sig/turbopuffer/internal/type/enum.rbs +32 -0
- data/sig/turbopuffer/internal/type/file_input.rbs +25 -0
- data/sig/turbopuffer/internal/type/hash_of.rbs +48 -0
- data/sig/turbopuffer/internal/type/request_parameters.rbs +19 -0
- data/sig/turbopuffer/internal/type/union.rbs +52 -0
- data/sig/turbopuffer/internal/type/unknown.rbs +26 -0
- data/sig/turbopuffer/internal/util.rbs +185 -0
- data/sig/turbopuffer/internal.rbs +9 -0
- data/sig/turbopuffer/models/aggregation_group.rbs +7 -0
- data/sig/turbopuffer/models/attribute_schema.rbs +11 -0
- data/sig/turbopuffer/models/attribute_schema_config.rbs +52 -0
- data/sig/turbopuffer/models/attribute_type.rbs +5 -0
- data/sig/turbopuffer/models/bm25_clause_params.rbs +15 -0
- data/sig/turbopuffer/models/client_namespaces_params.rbs +38 -0
- data/sig/turbopuffer/models/columns.rbs +42 -0
- data/sig/turbopuffer/models/contains_all_tokens_filter_params.rbs +15 -0
- data/sig/turbopuffer/models/distance_metric.rbs +17 -0
- data/sig/turbopuffer/models/full_text_search.rbs +11 -0
- data/sig/turbopuffer/models/full_text_search_config.rbs +75 -0
- data/sig/turbopuffer/models/id.rbs +11 -0
- data/sig/turbopuffer/models/include_attributes.rbs +13 -0
- data/sig/turbopuffer/models/language.rbs +48 -0
- data/sig/turbopuffer/models/namespace_delete_all_params.rbs +25 -0
- data/sig/turbopuffer/models/namespace_delete_all_response.rbs +13 -0
- data/sig/turbopuffer/models/namespace_explain_query_params.rbs +141 -0
- data/sig/turbopuffer/models/namespace_explain_query_response.rbs +15 -0
- data/sig/turbopuffer/models/namespace_hint_cache_warm_params.rbs +25 -0
- data/sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs +18 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +35 -0
- data/sig/turbopuffer/models/namespace_metadata_params.rbs +25 -0
- data/sig/turbopuffer/models/namespace_multi_query_params.rbs +86 -0
- data/sig/turbopuffer/models/namespace_multi_query_response.rbs +65 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +139 -0
- data/sig/turbopuffer/models/namespace_query_response.rbs +48 -0
- data/sig/turbopuffer/models/namespace_recall_params.rbs +63 -0
- data/sig/turbopuffer/models/namespace_recall_response.rbs +61 -0
- data/sig/turbopuffer/models/namespace_schema_params.rbs +25 -0
- data/sig/turbopuffer/models/namespace_schema_response.rbs +8 -0
- data/sig/turbopuffer/models/namespace_summary.rbs +13 -0
- data/sig/turbopuffer/models/namespace_update_schema_params.rbs +37 -0
- data/sig/turbopuffer/models/namespace_update_schema_response.rbs +8 -0
- data/sig/turbopuffer/models/namespace_write_params.rbs +156 -0
- data/sig/turbopuffer/models/namespace_write_response.rbs +56 -0
- data/sig/turbopuffer/models/query.rbs +75 -0
- data/sig/turbopuffer/models/query_billing.rbs +25 -0
- data/sig/turbopuffer/models/query_performance.rbs +45 -0
- data/sig/turbopuffer/models/row.rbs +24 -0
- data/sig/turbopuffer/models/tokenizer.rbs +16 -0
- data/sig/turbopuffer/models/vector.rbs +13 -0
- data/sig/turbopuffer/models/vector_encoding.rbs +14 -0
- data/sig/turbopuffer/models/write_billing.rbs +27 -0
- data/sig/turbopuffer/models.rbs +69 -0
- data/sig/turbopuffer/namespace.rbs +5 -0
- data/sig/turbopuffer/request_options.rbs +36 -0
- data/sig/turbopuffer/resources/namespaces.rbs +99 -0
- data/sig/turbopuffer/version.rbs +3 -0
- metadata +224 -29
- data/.standard.yml +0 -3
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -10
- data/sig/turbopuffer.rbs +0 -4
@@ -0,0 +1,273 @@
|
|
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
|
+
# Groups documents by the specified attributes (the "group key") before computing
|
73
|
+
# aggregates. Aggregates are computed separately for each group.
|
74
|
+
sig { returns(T.nilable(T::Array[String])) }
|
75
|
+
attr_reader :group_by
|
76
|
+
|
77
|
+
sig { params(group_by: T::Array[String]).void }
|
78
|
+
attr_writer :group_by
|
79
|
+
|
80
|
+
# Whether to include attributes in the response.
|
81
|
+
sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
|
82
|
+
attr_reader :include_attributes
|
83
|
+
|
84
|
+
sig do
|
85
|
+
params(
|
86
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants
|
87
|
+
).void
|
88
|
+
end
|
89
|
+
attr_writer :include_attributes
|
90
|
+
|
91
|
+
# How to rank the documents in the namespace.
|
92
|
+
sig { returns(T.nilable(T.anything)) }
|
93
|
+
attr_reader :rank_by
|
94
|
+
|
95
|
+
sig { params(rank_by: T.anything).void }
|
96
|
+
attr_writer :rank_by
|
97
|
+
|
98
|
+
# The number of results to return.
|
99
|
+
sig { returns(T.nilable(Integer)) }
|
100
|
+
attr_reader :top_k
|
101
|
+
|
102
|
+
sig { params(top_k: Integer).void }
|
103
|
+
attr_writer :top_k
|
104
|
+
|
105
|
+
# The encoding to use for vectors in the response.
|
106
|
+
sig { returns(T.nilable(Turbopuffer::VectorEncoding::OrSymbol)) }
|
107
|
+
attr_reader :vector_encoding
|
108
|
+
|
109
|
+
sig do
|
110
|
+
params(vector_encoding: Turbopuffer::VectorEncoding::OrSymbol).void
|
111
|
+
end
|
112
|
+
attr_writer :vector_encoding
|
113
|
+
|
114
|
+
sig do
|
115
|
+
params(
|
116
|
+
namespace: String,
|
117
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
118
|
+
consistency:
|
119
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::OrHash,
|
120
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
121
|
+
exclude_attributes: T::Array[String],
|
122
|
+
filters: T.anything,
|
123
|
+
group_by: T::Array[String],
|
124
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
125
|
+
rank_by: T.anything,
|
126
|
+
top_k: Integer,
|
127
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
128
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
129
|
+
).returns(T.attached_class)
|
130
|
+
end
|
131
|
+
def self.new(
|
132
|
+
namespace: nil,
|
133
|
+
# Aggregations to compute over all documents in the namespace that match the
|
134
|
+
# filters.
|
135
|
+
aggregate_by: nil,
|
136
|
+
# The consistency level for a query.
|
137
|
+
consistency: nil,
|
138
|
+
# A function used to calculate vector similarity.
|
139
|
+
distance_metric: nil,
|
140
|
+
# List of attribute names to exclude from the response. All other attributes will
|
141
|
+
# be included in the response.
|
142
|
+
exclude_attributes: nil,
|
143
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
144
|
+
# WHERE clause.
|
145
|
+
filters: nil,
|
146
|
+
# Groups documents by the specified attributes (the "group key") before computing
|
147
|
+
# aggregates. Aggregates are computed separately for each group.
|
148
|
+
group_by: nil,
|
149
|
+
# Whether to include attributes in the response.
|
150
|
+
include_attributes: nil,
|
151
|
+
# How to rank the documents in the namespace.
|
152
|
+
rank_by: nil,
|
153
|
+
# The number of results to return.
|
154
|
+
top_k: nil,
|
155
|
+
# The encoding to use for vectors in the response.
|
156
|
+
vector_encoding: nil,
|
157
|
+
request_options: {}
|
158
|
+
)
|
159
|
+
end
|
160
|
+
|
161
|
+
sig do
|
162
|
+
override.returns(
|
163
|
+
{
|
164
|
+
namespace: String,
|
165
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
166
|
+
consistency: Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
167
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
168
|
+
exclude_attributes: T::Array[String],
|
169
|
+
filters: T.anything,
|
170
|
+
group_by: T::Array[String],
|
171
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
172
|
+
rank_by: T.anything,
|
173
|
+
top_k: Integer,
|
174
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
175
|
+
request_options: Turbopuffer::RequestOptions
|
176
|
+
}
|
177
|
+
)
|
178
|
+
end
|
179
|
+
def to_hash
|
180
|
+
end
|
181
|
+
|
182
|
+
class Consistency < Turbopuffer::Internal::Type::BaseModel
|
183
|
+
OrHash =
|
184
|
+
T.type_alias do
|
185
|
+
T.any(
|
186
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency,
|
187
|
+
Turbopuffer::Internal::AnyHash
|
188
|
+
)
|
189
|
+
end
|
190
|
+
|
191
|
+
# The query's consistency level.
|
192
|
+
sig do
|
193
|
+
returns(
|
194
|
+
T.nilable(
|
195
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
196
|
+
)
|
197
|
+
)
|
198
|
+
end
|
199
|
+
attr_reader :level
|
200
|
+
|
201
|
+
sig do
|
202
|
+
params(
|
203
|
+
level:
|
204
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
205
|
+
).void
|
206
|
+
end
|
207
|
+
attr_writer :level
|
208
|
+
|
209
|
+
# The consistency level for a query.
|
210
|
+
sig do
|
211
|
+
params(
|
212
|
+
level:
|
213
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
214
|
+
).returns(T.attached_class)
|
215
|
+
end
|
216
|
+
def self.new(
|
217
|
+
# The query's consistency level.
|
218
|
+
level: nil
|
219
|
+
)
|
220
|
+
end
|
221
|
+
|
222
|
+
sig do
|
223
|
+
override.returns(
|
224
|
+
{
|
225
|
+
level:
|
226
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::OrSymbol
|
227
|
+
}
|
228
|
+
)
|
229
|
+
end
|
230
|
+
def to_hash
|
231
|
+
end
|
232
|
+
|
233
|
+
# The query's consistency level.
|
234
|
+
module Level
|
235
|
+
extend Turbopuffer::Internal::Type::Enum
|
236
|
+
|
237
|
+
TaggedSymbol =
|
238
|
+
T.type_alias do
|
239
|
+
T.all(
|
240
|
+
Symbol,
|
241
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level
|
242
|
+
)
|
243
|
+
end
|
244
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
245
|
+
|
246
|
+
# Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
|
247
|
+
STRONG =
|
248
|
+
T.let(
|
249
|
+
:strong,
|
250
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
251
|
+
)
|
252
|
+
|
253
|
+
# Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
|
254
|
+
EVENTUAL =
|
255
|
+
T.let(
|
256
|
+
:eventual,
|
257
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
258
|
+
)
|
259
|
+
|
260
|
+
sig do
|
261
|
+
override.returns(
|
262
|
+
T::Array[
|
263
|
+
Turbopuffer::NamespaceExplainQueryParams::Consistency::Level::TaggedSymbol
|
264
|
+
]
|
265
|
+
)
|
266
|
+
end
|
267
|
+
def self.values
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
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
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceHintCacheWarmParams < 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::NamespaceHintCacheWarmParams,
|
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
|
+
sig do
|
24
|
+
params(
|
25
|
+
namespace: String,
|
26
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
27
|
+
).returns(T.attached_class)
|
28
|
+
end
|
29
|
+
def self.new(namespace: nil, request_options: {})
|
30
|
+
end
|
31
|
+
|
32
|
+
sig do
|
33
|
+
override.returns(
|
34
|
+
{ namespace: String, request_options: Turbopuffer::RequestOptions }
|
35
|
+
)
|
36
|
+
end
|
37
|
+
def to_hash
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceHintCacheWarmResponse < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Turbopuffer::Models::NamespaceHintCacheWarmResponse,
|
10
|
+
Turbopuffer::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# The status of the request.
|
15
|
+
sig { returns(Symbol) }
|
16
|
+
attr_accessor :status
|
17
|
+
|
18
|
+
sig { returns(T.nilable(String)) }
|
19
|
+
attr_reader :message
|
20
|
+
|
21
|
+
sig { params(message: String).void }
|
22
|
+
attr_writer :message
|
23
|
+
|
24
|
+
# The response to a successful cache warm request.
|
25
|
+
sig { params(message: String, status: Symbol).returns(T.attached_class) }
|
26
|
+
def self.new(
|
27
|
+
message: nil,
|
28
|
+
# The status of the request.
|
29
|
+
status: :ACCEPTED
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
sig { override.returns({ status: Symbol, message: String }) }
|
34
|
+
def to_hash
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceMetadata < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Turbopuffer::NamespaceMetadata, Turbopuffer::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
# The approximate number of logical bytes in the namespace.
|
12
|
+
sig { returns(Integer) }
|
13
|
+
attr_accessor :approx_logical_bytes
|
14
|
+
|
15
|
+
# The approximate number of rows in the namespace.
|
16
|
+
sig { returns(Integer) }
|
17
|
+
attr_accessor :approx_row_count
|
18
|
+
|
19
|
+
# The timestamp when the namespace was created.
|
20
|
+
sig { returns(Time) }
|
21
|
+
attr_accessor :created_at
|
22
|
+
|
23
|
+
# The schema of the namespace.
|
24
|
+
sig { returns(T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]) }
|
25
|
+
attr_accessor :schema
|
26
|
+
|
27
|
+
# Metadata about a namespace.
|
28
|
+
sig do
|
29
|
+
params(
|
30
|
+
approx_logical_bytes: Integer,
|
31
|
+
approx_row_count: Integer,
|
32
|
+
created_at: Time,
|
33
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig::OrHash]
|
34
|
+
).returns(T.attached_class)
|
35
|
+
end
|
36
|
+
def self.new(
|
37
|
+
# The approximate number of logical bytes in the namespace.
|
38
|
+
approx_logical_bytes:,
|
39
|
+
# The approximate number of rows in the namespace.
|
40
|
+
approx_row_count:,
|
41
|
+
# The timestamp when the namespace was created.
|
42
|
+
created_at:,
|
43
|
+
# The schema of the namespace.
|
44
|
+
schema:
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
sig do
|
49
|
+
override.returns(
|
50
|
+
{
|
51
|
+
approx_logical_bytes: Integer,
|
52
|
+
approx_row_count: Integer,
|
53
|
+
created_at: Time,
|
54
|
+
schema: T::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
|
55
|
+
}
|
56
|
+
)
|
57
|
+
end
|
58
|
+
def to_hash
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceMetadataParams < 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::NamespaceMetadataParams,
|
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
|
+
sig do
|
24
|
+
params(
|
25
|
+
namespace: String,
|
26
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
27
|
+
).returns(T.attached_class)
|
28
|
+
end
|
29
|
+
def self.new(namespace: nil, request_options: {})
|
30
|
+
end
|
31
|
+
|
32
|
+
sig do
|
33
|
+
override.returns(
|
34
|
+
{ namespace: String, request_options: Turbopuffer::RequestOptions }
|
35
|
+
)
|
36
|
+
end
|
37
|
+
def to_hash
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceMultiQueryParams < 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::NamespaceMultiQueryParams,
|
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
|
+
sig { returns(T::Array[Turbopuffer::Query]) }
|
24
|
+
attr_accessor :queries
|
25
|
+
|
26
|
+
# The consistency level for a query.
|
27
|
+
sig do
|
28
|
+
returns(T.nilable(Turbopuffer::NamespaceMultiQueryParams::Consistency))
|
29
|
+
end
|
30
|
+
attr_reader :consistency
|
31
|
+
|
32
|
+
sig do
|
33
|
+
params(
|
34
|
+
consistency:
|
35
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::OrHash
|
36
|
+
).void
|
37
|
+
end
|
38
|
+
attr_writer :consistency
|
39
|
+
|
40
|
+
# The encoding to use for vectors in the response.
|
41
|
+
sig { returns(T.nilable(Turbopuffer::VectorEncoding::OrSymbol)) }
|
42
|
+
attr_reader :vector_encoding
|
43
|
+
|
44
|
+
sig do
|
45
|
+
params(vector_encoding: Turbopuffer::VectorEncoding::OrSymbol).void
|
46
|
+
end
|
47
|
+
attr_writer :vector_encoding
|
48
|
+
|
49
|
+
sig do
|
50
|
+
params(
|
51
|
+
queries: T::Array[Turbopuffer::Query::OrHash],
|
52
|
+
namespace: String,
|
53
|
+
consistency:
|
54
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::OrHash,
|
55
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
56
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
57
|
+
).returns(T.attached_class)
|
58
|
+
end
|
59
|
+
def self.new(
|
60
|
+
queries:,
|
61
|
+
namespace: nil,
|
62
|
+
# The consistency level for a query.
|
63
|
+
consistency: nil,
|
64
|
+
# The encoding to use for vectors in the response.
|
65
|
+
vector_encoding: nil,
|
66
|
+
request_options: {}
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
sig do
|
71
|
+
override.returns(
|
72
|
+
{
|
73
|
+
namespace: String,
|
74
|
+
queries: T::Array[Turbopuffer::Query],
|
75
|
+
consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency,
|
76
|
+
vector_encoding: Turbopuffer::VectorEncoding::OrSymbol,
|
77
|
+
request_options: Turbopuffer::RequestOptions
|
78
|
+
}
|
79
|
+
)
|
80
|
+
end
|
81
|
+
def to_hash
|
82
|
+
end
|
83
|
+
|
84
|
+
class Consistency < Turbopuffer::Internal::Type::BaseModel
|
85
|
+
OrHash =
|
86
|
+
T.type_alias do
|
87
|
+
T.any(
|
88
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency,
|
89
|
+
Turbopuffer::Internal::AnyHash
|
90
|
+
)
|
91
|
+
end
|
92
|
+
|
93
|
+
# The query's consistency level.
|
94
|
+
sig do
|
95
|
+
returns(
|
96
|
+
T.nilable(
|
97
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::OrSymbol
|
98
|
+
)
|
99
|
+
)
|
100
|
+
end
|
101
|
+
attr_reader :level
|
102
|
+
|
103
|
+
sig do
|
104
|
+
params(
|
105
|
+
level:
|
106
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::OrSymbol
|
107
|
+
).void
|
108
|
+
end
|
109
|
+
attr_writer :level
|
110
|
+
|
111
|
+
# The consistency level for a query.
|
112
|
+
sig do
|
113
|
+
params(
|
114
|
+
level:
|
115
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::OrSymbol
|
116
|
+
).returns(T.attached_class)
|
117
|
+
end
|
118
|
+
def self.new(
|
119
|
+
# The query's consistency level.
|
120
|
+
level: nil
|
121
|
+
)
|
122
|
+
end
|
123
|
+
|
124
|
+
sig do
|
125
|
+
override.returns(
|
126
|
+
{
|
127
|
+
level:
|
128
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::OrSymbol
|
129
|
+
}
|
130
|
+
)
|
131
|
+
end
|
132
|
+
def to_hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# The query's consistency level.
|
136
|
+
module Level
|
137
|
+
extend Turbopuffer::Internal::Type::Enum
|
138
|
+
|
139
|
+
TaggedSymbol =
|
140
|
+
T.type_alias do
|
141
|
+
T.all(
|
142
|
+
Symbol,
|
143
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level
|
144
|
+
)
|
145
|
+
end
|
146
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
147
|
+
|
148
|
+
# Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
|
149
|
+
STRONG =
|
150
|
+
T.let(
|
151
|
+
:strong,
|
152
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::TaggedSymbol
|
153
|
+
)
|
154
|
+
|
155
|
+
# Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
|
156
|
+
EVENTUAL =
|
157
|
+
T.let(
|
158
|
+
:eventual,
|
159
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::TaggedSymbol
|
160
|
+
)
|
161
|
+
|
162
|
+
sig do
|
163
|
+
override.returns(
|
164
|
+
T::Array[
|
165
|
+
Turbopuffer::NamespaceMultiQueryParams::Consistency::Level::TaggedSymbol
|
166
|
+
]
|
167
|
+
)
|
168
|
+
end
|
169
|
+
def self.values
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|