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,156 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type namespace_write_params =
|
4
|
+
{
|
5
|
+
namespace: String,
|
6
|
+
copy_from_namespace: String,
|
7
|
+
delete_by_filter: top,
|
8
|
+
delete_condition: top,
|
9
|
+
deletes: ::Array[Turbopuffer::Models::id],
|
10
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
11
|
+
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
12
|
+
patch_columns: Turbopuffer::Columns,
|
13
|
+
patch_condition: top,
|
14
|
+
patch_rows: ::Array[Turbopuffer::Row],
|
15
|
+
schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
16
|
+
upsert_columns: Turbopuffer::Columns,
|
17
|
+
upsert_condition: top,
|
18
|
+
upsert_rows: ::Array[Turbopuffer::Row]
|
19
|
+
}
|
20
|
+
& Turbopuffer::Internal::Type::request_parameters
|
21
|
+
|
22
|
+
class NamespaceWriteParams < Turbopuffer::Internal::Type::BaseModel
|
23
|
+
extend Turbopuffer::Internal::Type::RequestParameters::Converter
|
24
|
+
include Turbopuffer::Internal::Type::RequestParameters
|
25
|
+
|
26
|
+
attr_reader namespace: String?
|
27
|
+
|
28
|
+
def namespace=: (String) -> String
|
29
|
+
|
30
|
+
attr_reader copy_from_namespace: String?
|
31
|
+
|
32
|
+
def copy_from_namespace=: (String) -> String
|
33
|
+
|
34
|
+
attr_reader delete_by_filter: top?
|
35
|
+
|
36
|
+
def delete_by_filter=: (top) -> top
|
37
|
+
|
38
|
+
attr_reader delete_condition: top?
|
39
|
+
|
40
|
+
def delete_condition=: (top) -> top
|
41
|
+
|
42
|
+
attr_reader deletes: ::Array[Turbopuffer::Models::id]?
|
43
|
+
|
44
|
+
def deletes=: (
|
45
|
+
::Array[Turbopuffer::Models::id]
|
46
|
+
) -> ::Array[Turbopuffer::Models::id]
|
47
|
+
|
48
|
+
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
49
|
+
|
50
|
+
def distance_metric=: (
|
51
|
+
Turbopuffer::Models::distance_metric
|
52
|
+
) -> Turbopuffer::Models::distance_metric
|
53
|
+
|
54
|
+
attr_reader encryption: Turbopuffer::NamespaceWriteParams::Encryption?
|
55
|
+
|
56
|
+
def encryption=: (
|
57
|
+
Turbopuffer::NamespaceWriteParams::Encryption
|
58
|
+
) -> Turbopuffer::NamespaceWriteParams::Encryption
|
59
|
+
|
60
|
+
attr_reader patch_columns: Turbopuffer::Columns?
|
61
|
+
|
62
|
+
def patch_columns=: (Turbopuffer::Columns) -> Turbopuffer::Columns
|
63
|
+
|
64
|
+
attr_reader patch_condition: top?
|
65
|
+
|
66
|
+
def patch_condition=: (top) -> top
|
67
|
+
|
68
|
+
attr_reader patch_rows: ::Array[Turbopuffer::Row]?
|
69
|
+
|
70
|
+
def patch_rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
|
71
|
+
|
72
|
+
attr_reader schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema]?
|
73
|
+
|
74
|
+
def schema=: (
|
75
|
+
::Hash[Symbol, Turbopuffer::Models::attribute_schema]
|
76
|
+
) -> ::Hash[Symbol, Turbopuffer::Models::attribute_schema]
|
77
|
+
|
78
|
+
attr_reader upsert_columns: Turbopuffer::Columns?
|
79
|
+
|
80
|
+
def upsert_columns=: (Turbopuffer::Columns) -> Turbopuffer::Columns
|
81
|
+
|
82
|
+
attr_reader upsert_condition: top?
|
83
|
+
|
84
|
+
def upsert_condition=: (top) -> top
|
85
|
+
|
86
|
+
attr_reader upsert_rows: ::Array[Turbopuffer::Row]?
|
87
|
+
|
88
|
+
def upsert_rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
|
89
|
+
|
90
|
+
def initialize: (
|
91
|
+
?namespace: String,
|
92
|
+
?copy_from_namespace: String,
|
93
|
+
?delete_by_filter: top,
|
94
|
+
?delete_condition: top,
|
95
|
+
?deletes: ::Array[Turbopuffer::Models::id],
|
96
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
97
|
+
?encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
98
|
+
?patch_columns: Turbopuffer::Columns,
|
99
|
+
?patch_condition: top,
|
100
|
+
?patch_rows: ::Array[Turbopuffer::Row],
|
101
|
+
?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
102
|
+
?upsert_columns: Turbopuffer::Columns,
|
103
|
+
?upsert_condition: top,
|
104
|
+
?upsert_rows: ::Array[Turbopuffer::Row],
|
105
|
+
?request_options: Turbopuffer::request_opts
|
106
|
+
) -> void
|
107
|
+
|
108
|
+
def to_hash: -> {
|
109
|
+
namespace: String,
|
110
|
+
copy_from_namespace: String,
|
111
|
+
delete_by_filter: top,
|
112
|
+
delete_condition: top,
|
113
|
+
deletes: ::Array[Turbopuffer::Models::id],
|
114
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
115
|
+
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
116
|
+
patch_columns: Turbopuffer::Columns,
|
117
|
+
patch_condition: top,
|
118
|
+
patch_rows: ::Array[Turbopuffer::Row],
|
119
|
+
schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
120
|
+
upsert_columns: Turbopuffer::Columns,
|
121
|
+
upsert_condition: top,
|
122
|
+
upsert_rows: ::Array[Turbopuffer::Row],
|
123
|
+
request_options: Turbopuffer::RequestOptions
|
124
|
+
}
|
125
|
+
|
126
|
+
type encryption =
|
127
|
+
{ cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek }
|
128
|
+
|
129
|
+
class Encryption < Turbopuffer::Internal::Type::BaseModel
|
130
|
+
attr_reader cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek?
|
131
|
+
|
132
|
+
def cmek=: (
|
133
|
+
Turbopuffer::NamespaceWriteParams::Encryption::Cmek
|
134
|
+
) -> Turbopuffer::NamespaceWriteParams::Encryption::Cmek
|
135
|
+
|
136
|
+
def initialize: (
|
137
|
+
?cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek
|
138
|
+
) -> void
|
139
|
+
|
140
|
+
def to_hash: -> {
|
141
|
+
cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek
|
142
|
+
}
|
143
|
+
|
144
|
+
type cmek = { key_name: String }
|
145
|
+
|
146
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
147
|
+
attr_accessor key_name: String
|
148
|
+
|
149
|
+
def initialize: (key_name: String) -> void
|
150
|
+
|
151
|
+
def to_hash: -> { key_name: String }
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type namespace_write_response =
|
4
|
+
{
|
5
|
+
billing: Turbopuffer::WriteBilling,
|
6
|
+
message: String,
|
7
|
+
rows_affected: Integer,
|
8
|
+
status: :OK,
|
9
|
+
rows_deleted: Integer,
|
10
|
+
rows_patched: Integer,
|
11
|
+
rows_upserted: Integer
|
12
|
+
}
|
13
|
+
|
14
|
+
class NamespaceWriteResponse < Turbopuffer::Internal::Type::BaseModel
|
15
|
+
attr_accessor billing: Turbopuffer::WriteBilling
|
16
|
+
|
17
|
+
attr_accessor message: String
|
18
|
+
|
19
|
+
attr_accessor rows_affected: Integer
|
20
|
+
|
21
|
+
attr_accessor status: :OK
|
22
|
+
|
23
|
+
attr_reader rows_deleted: Integer?
|
24
|
+
|
25
|
+
def rows_deleted=: (Integer) -> Integer
|
26
|
+
|
27
|
+
attr_reader rows_patched: Integer?
|
28
|
+
|
29
|
+
def rows_patched=: (Integer) -> Integer
|
30
|
+
|
31
|
+
attr_reader rows_upserted: Integer?
|
32
|
+
|
33
|
+
def rows_upserted=: (Integer) -> Integer
|
34
|
+
|
35
|
+
def initialize: (
|
36
|
+
billing: Turbopuffer::WriteBilling,
|
37
|
+
message: String,
|
38
|
+
rows_affected: Integer,
|
39
|
+
?rows_deleted: Integer,
|
40
|
+
?rows_patched: Integer,
|
41
|
+
?rows_upserted: Integer,
|
42
|
+
?status: :OK
|
43
|
+
) -> void
|
44
|
+
|
45
|
+
def to_hash: -> {
|
46
|
+
billing: Turbopuffer::WriteBilling,
|
47
|
+
message: String,
|
48
|
+
rows_affected: Integer,
|
49
|
+
status: :OK,
|
50
|
+
rows_deleted: Integer,
|
51
|
+
rows_patched: Integer,
|
52
|
+
rows_upserted: Integer
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type query =
|
4
|
+
{
|
5
|
+
aggregate_by: ::Hash[Symbol, top],
|
6
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
7
|
+
exclude_attributes: ::Array[String],
|
8
|
+
filters: top,
|
9
|
+
group_by: ::Array[String],
|
10
|
+
include_attributes: Turbopuffer::Models::include_attributes,
|
11
|
+
rank_by: top,
|
12
|
+
top_k: Integer
|
13
|
+
}
|
14
|
+
|
15
|
+
class Query < Turbopuffer::Internal::Type::BaseModel
|
16
|
+
attr_reader aggregate_by: ::Hash[Symbol, top]?
|
17
|
+
|
18
|
+
def aggregate_by=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
19
|
+
|
20
|
+
attr_reader distance_metric: Turbopuffer::Models::distance_metric?
|
21
|
+
|
22
|
+
def distance_metric=: (
|
23
|
+
Turbopuffer::Models::distance_metric
|
24
|
+
) -> Turbopuffer::Models::distance_metric
|
25
|
+
|
26
|
+
attr_reader exclude_attributes: ::Array[String]?
|
27
|
+
|
28
|
+
def exclude_attributes=: (::Array[String]) -> ::Array[String]
|
29
|
+
|
30
|
+
attr_reader filters: top?
|
31
|
+
|
32
|
+
def filters=: (top) -> top
|
33
|
+
|
34
|
+
attr_reader group_by: ::Array[String]?
|
35
|
+
|
36
|
+
def group_by=: (::Array[String]) -> ::Array[String]
|
37
|
+
|
38
|
+
attr_reader include_attributes: Turbopuffer::Models::include_attributes?
|
39
|
+
|
40
|
+
def include_attributes=: (
|
41
|
+
Turbopuffer::Models::include_attributes
|
42
|
+
) -> Turbopuffer::Models::include_attributes
|
43
|
+
|
44
|
+
attr_reader rank_by: top?
|
45
|
+
|
46
|
+
def rank_by=: (top) -> top
|
47
|
+
|
48
|
+
attr_reader top_k: Integer?
|
49
|
+
|
50
|
+
def top_k=: (Integer) -> Integer
|
51
|
+
|
52
|
+
def initialize: (
|
53
|
+
?aggregate_by: ::Hash[Symbol, top],
|
54
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
55
|
+
?exclude_attributes: ::Array[String],
|
56
|
+
?filters: top,
|
57
|
+
?group_by: ::Array[String],
|
58
|
+
?include_attributes: Turbopuffer::Models::include_attributes,
|
59
|
+
?rank_by: top,
|
60
|
+
?top_k: Integer
|
61
|
+
) -> void
|
62
|
+
|
63
|
+
def to_hash: -> {
|
64
|
+
aggregate_by: ::Hash[Symbol, top],
|
65
|
+
distance_metric: Turbopuffer::Models::distance_metric,
|
66
|
+
exclude_attributes: ::Array[String],
|
67
|
+
filters: top,
|
68
|
+
group_by: ::Array[String],
|
69
|
+
include_attributes: Turbopuffer::Models::include_attributes,
|
70
|
+
rank_by: top,
|
71
|
+
top_k: Integer
|
72
|
+
}
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type query_billing =
|
4
|
+
{
|
5
|
+
billable_logical_bytes_queried: Integer,
|
6
|
+
billable_logical_bytes_returned: Integer
|
7
|
+
}
|
8
|
+
|
9
|
+
class QueryBilling < Turbopuffer::Internal::Type::BaseModel
|
10
|
+
attr_accessor billable_logical_bytes_queried: Integer
|
11
|
+
|
12
|
+
attr_accessor billable_logical_bytes_returned: Integer
|
13
|
+
|
14
|
+
def initialize: (
|
15
|
+
billable_logical_bytes_queried: Integer,
|
16
|
+
billable_logical_bytes_returned: Integer
|
17
|
+
) -> void
|
18
|
+
|
19
|
+
def to_hash: -> {
|
20
|
+
billable_logical_bytes_queried: Integer,
|
21
|
+
billable_logical_bytes_returned: Integer
|
22
|
+
}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type query_performance =
|
4
|
+
{
|
5
|
+
approx_namespace_size: Integer,
|
6
|
+
cache_hit_ratio: Float,
|
7
|
+
cache_temperature: String,
|
8
|
+
exhaustive_search_count: Integer,
|
9
|
+
query_execution_ms: Integer,
|
10
|
+
server_total_ms: Integer
|
11
|
+
}
|
12
|
+
|
13
|
+
class QueryPerformance < Turbopuffer::Internal::Type::BaseModel
|
14
|
+
attr_accessor approx_namespace_size: Integer
|
15
|
+
|
16
|
+
attr_accessor cache_hit_ratio: Float
|
17
|
+
|
18
|
+
attr_accessor cache_temperature: String
|
19
|
+
|
20
|
+
attr_accessor exhaustive_search_count: Integer
|
21
|
+
|
22
|
+
attr_accessor query_execution_ms: Integer
|
23
|
+
|
24
|
+
attr_accessor server_total_ms: Integer
|
25
|
+
|
26
|
+
def initialize: (
|
27
|
+
approx_namespace_size: Integer,
|
28
|
+
cache_hit_ratio: Float,
|
29
|
+
cache_temperature: String,
|
30
|
+
exhaustive_search_count: Integer,
|
31
|
+
query_execution_ms: Integer,
|
32
|
+
server_total_ms: Integer
|
33
|
+
) -> void
|
34
|
+
|
35
|
+
def to_hash: -> {
|
36
|
+
approx_namespace_size: Integer,
|
37
|
+
cache_hit_ratio: Float,
|
38
|
+
cache_temperature: String,
|
39
|
+
exhaustive_search_count: Integer,
|
40
|
+
query_execution_ms: Integer,
|
41
|
+
server_total_ms: Integer
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type row =
|
4
|
+
{ id: Turbopuffer::Models::id, vector: Turbopuffer::Models::vector }
|
5
|
+
|
6
|
+
class Row < Turbopuffer::Internal::Type::BaseModel
|
7
|
+
attr_accessor id: Turbopuffer::Models::id
|
8
|
+
|
9
|
+
attr_reader vector: Turbopuffer::Models::vector?
|
10
|
+
|
11
|
+
def vector=: (Turbopuffer::Models::vector) -> Turbopuffer::Models::vector
|
12
|
+
|
13
|
+
def initialize: (
|
14
|
+
id: Turbopuffer::Models::id,
|
15
|
+
?vector: Turbopuffer::Models::vector
|
16
|
+
) -> void
|
17
|
+
|
18
|
+
def to_hash: -> {
|
19
|
+
id: Turbopuffer::Models::id,
|
20
|
+
vector: Turbopuffer::Models::vector
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type tokenizer = :pre_tokenized_array | :word_v0 | :word_v1 | :word_v2
|
4
|
+
|
5
|
+
module Tokenizer
|
6
|
+
extend Turbopuffer::Internal::Type::Enum
|
7
|
+
|
8
|
+
PRE_TOKENIZED_ARRAY: :pre_tokenized_array
|
9
|
+
WORD_V0: :word_v0
|
10
|
+
WORD_V1: :word_v1
|
11
|
+
WORD_V2: :word_v2
|
12
|
+
|
13
|
+
def self?.values: -> ::Array[Turbopuffer::Models::tokenizer]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type vector = ::Array[Float] | String
|
4
|
+
|
5
|
+
module Vector
|
6
|
+
extend Turbopuffer::Internal::Type::Union
|
7
|
+
|
8
|
+
def self?.variants: -> ::Array[Turbopuffer::Models::vector]
|
9
|
+
|
10
|
+
FloatArray: Turbopuffer::Internal::Type::Converter
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type vector_encoding = :float | :base64
|
4
|
+
|
5
|
+
module VectorEncoding
|
6
|
+
extend Turbopuffer::Internal::Type::Enum
|
7
|
+
|
8
|
+
FLOAT: :float
|
9
|
+
BASE64: :base64
|
10
|
+
|
11
|
+
def self?.values: -> ::Array[Turbopuffer::Models::vector_encoding]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Models
|
3
|
+
type write_billing =
|
4
|
+
{
|
5
|
+
billable_logical_bytes_written: Integer,
|
6
|
+
query: Turbopuffer::QueryBilling
|
7
|
+
}
|
8
|
+
|
9
|
+
class WriteBilling < Turbopuffer::Internal::Type::BaseModel
|
10
|
+
attr_accessor billable_logical_bytes_written: Integer
|
11
|
+
|
12
|
+
attr_reader query: Turbopuffer::QueryBilling?
|
13
|
+
|
14
|
+
def query=: (Turbopuffer::QueryBilling) -> Turbopuffer::QueryBilling
|
15
|
+
|
16
|
+
def initialize: (
|
17
|
+
billable_logical_bytes_written: Integer,
|
18
|
+
?query: Turbopuffer::QueryBilling
|
19
|
+
) -> void
|
20
|
+
|
21
|
+
def to_hash: -> {
|
22
|
+
billable_logical_bytes_written: Integer,
|
23
|
+
query: Turbopuffer::QueryBilling
|
24
|
+
}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
AggregationGroup: Turbopuffer::Internal::Type::Converter
|
3
|
+
|
4
|
+
module AttributeSchema = Turbopuffer::Models::AttributeSchema
|
5
|
+
|
6
|
+
class AttributeSchemaConfig = Turbopuffer::Models::AttributeSchemaConfig
|
7
|
+
|
8
|
+
class AttributeType = Turbopuffer::Models::AttributeType
|
9
|
+
|
10
|
+
class Bm25ClauseParams = Turbopuffer::Models::Bm25ClauseParams
|
11
|
+
|
12
|
+
class ClientNamespacesParams = Turbopuffer::Models::ClientNamespacesParams
|
13
|
+
|
14
|
+
class Columns = Turbopuffer::Models::Columns
|
15
|
+
|
16
|
+
class ContainsAllTokensFilterParams = Turbopuffer::Models::ContainsAllTokensFilterParams
|
17
|
+
|
18
|
+
module DistanceMetric = Turbopuffer::Models::DistanceMetric
|
19
|
+
|
20
|
+
module FullTextSearch = Turbopuffer::Models::FullTextSearch
|
21
|
+
|
22
|
+
class FullTextSearchConfig = Turbopuffer::Models::FullTextSearchConfig
|
23
|
+
|
24
|
+
module ID = Turbopuffer::Models::ID
|
25
|
+
|
26
|
+
module IncludeAttributes = Turbopuffer::Models::IncludeAttributes
|
27
|
+
|
28
|
+
module Language = Turbopuffer::Models::Language
|
29
|
+
|
30
|
+
class NamespaceDeleteAllParams = Turbopuffer::Models::NamespaceDeleteAllParams
|
31
|
+
|
32
|
+
class NamespaceExplainQueryParams = Turbopuffer::Models::NamespaceExplainQueryParams
|
33
|
+
|
34
|
+
class NamespaceHintCacheWarmParams = Turbopuffer::Models::NamespaceHintCacheWarmParams
|
35
|
+
|
36
|
+
class NamespaceMetadata = Turbopuffer::Models::NamespaceMetadata
|
37
|
+
|
38
|
+
class NamespaceMetadataParams = Turbopuffer::Models::NamespaceMetadataParams
|
39
|
+
|
40
|
+
class NamespaceMultiQueryParams = Turbopuffer::Models::NamespaceMultiQueryParams
|
41
|
+
|
42
|
+
class NamespaceQueryParams = Turbopuffer::Models::NamespaceQueryParams
|
43
|
+
|
44
|
+
class NamespaceRecallParams = Turbopuffer::Models::NamespaceRecallParams
|
45
|
+
|
46
|
+
class NamespaceSchemaParams = Turbopuffer::Models::NamespaceSchemaParams
|
47
|
+
|
48
|
+
class NamespaceSummary = Turbopuffer::Models::NamespaceSummary
|
49
|
+
|
50
|
+
class NamespaceUpdateSchemaParams = Turbopuffer::Models::NamespaceUpdateSchemaParams
|
51
|
+
|
52
|
+
class NamespaceWriteParams = Turbopuffer::Models::NamespaceWriteParams
|
53
|
+
|
54
|
+
class Query = Turbopuffer::Models::Query
|
55
|
+
|
56
|
+
class QueryBilling = Turbopuffer::Models::QueryBilling
|
57
|
+
|
58
|
+
class QueryPerformance = Turbopuffer::Models::QueryPerformance
|
59
|
+
|
60
|
+
class Row = Turbopuffer::Models::Row
|
61
|
+
|
62
|
+
module Tokenizer = Turbopuffer::Models::Tokenizer
|
63
|
+
|
64
|
+
module Vector = Turbopuffer::Models::Vector
|
65
|
+
|
66
|
+
module VectorEncoding = Turbopuffer::Models::VectorEncoding
|
67
|
+
|
68
|
+
class WriteBilling = Turbopuffer::Models::WriteBilling
|
69
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
type request_opts =
|
3
|
+
Turbopuffer::RequestOptions
|
4
|
+
| Turbopuffer::request_options
|
5
|
+
| ::Hash[Symbol, top]
|
6
|
+
|
7
|
+
type request_options =
|
8
|
+
{
|
9
|
+
idempotency_key: String?,
|
10
|
+
extra_query: ::Hash[String, (::Array[String] | String)?]?,
|
11
|
+
extra_headers: ::Hash[String, String?]?,
|
12
|
+
extra_body: top?,
|
13
|
+
max_retries: Integer?,
|
14
|
+
timeout: Float?
|
15
|
+
}
|
16
|
+
|
17
|
+
class RequestOptions < Turbopuffer::Internal::Type::BaseModel
|
18
|
+
def self.validate!: (Turbopuffer::request_opts opts) -> void
|
19
|
+
|
20
|
+
attr_accessor idempotency_key: String?
|
21
|
+
|
22
|
+
attr_accessor extra_query: ::Hash[String, (::Array[String] | String)?]?
|
23
|
+
|
24
|
+
attr_accessor extra_headers: ::Hash[String, String?]?
|
25
|
+
|
26
|
+
attr_accessor extra_body: top?
|
27
|
+
|
28
|
+
attr_accessor max_retries: Integer?
|
29
|
+
|
30
|
+
attr_accessor timeout: Float?
|
31
|
+
|
32
|
+
def initialize: (
|
33
|
+
?Turbopuffer::request_options | ::Hash[Symbol, top] values
|
34
|
+
) -> void
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module Turbopuffer
|
2
|
+
module Resources
|
3
|
+
class Namespaces
|
4
|
+
def delete_all: (
|
5
|
+
?namespace: String,
|
6
|
+
?request_options: Turbopuffer::request_opts
|
7
|
+
) -> Turbopuffer::Models::NamespaceDeleteAllResponse
|
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
|
+
?group_by: ::Array[String],
|
17
|
+
?include_attributes: Turbopuffer::Models::include_attributes,
|
18
|
+
?rank_by: top,
|
19
|
+
?top_k: Integer,
|
20
|
+
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
21
|
+
?request_options: Turbopuffer::request_opts
|
22
|
+
) -> Turbopuffer::Models::NamespaceExplainQueryResponse
|
23
|
+
|
24
|
+
def hint_cache_warm: (
|
25
|
+
?namespace: String,
|
26
|
+
?request_options: Turbopuffer::request_opts
|
27
|
+
) -> Turbopuffer::Models::NamespaceHintCacheWarmResponse
|
28
|
+
|
29
|
+
def metadata: (
|
30
|
+
?namespace: String,
|
31
|
+
?request_options: Turbopuffer::request_opts
|
32
|
+
) -> Turbopuffer::NamespaceMetadata
|
33
|
+
|
34
|
+
def multi_query: (
|
35
|
+
queries: ::Array[Turbopuffer::Query],
|
36
|
+
?namespace: String,
|
37
|
+
?consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency,
|
38
|
+
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
39
|
+
?request_options: Turbopuffer::request_opts
|
40
|
+
) -> Turbopuffer::Models::NamespaceMultiQueryResponse
|
41
|
+
|
42
|
+
def query: (
|
43
|
+
?namespace: String,
|
44
|
+
?aggregate_by: ::Hash[Symbol, top],
|
45
|
+
?consistency: Turbopuffer::NamespaceQueryParams::Consistency,
|
46
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
47
|
+
?exclude_attributes: ::Array[String],
|
48
|
+
?filters: top,
|
49
|
+
?group_by: ::Array[String],
|
50
|
+
?include_attributes: Turbopuffer::Models::include_attributes,
|
51
|
+
?rank_by: top,
|
52
|
+
?top_k: Integer,
|
53
|
+
?vector_encoding: Turbopuffer::Models::vector_encoding,
|
54
|
+
?request_options: Turbopuffer::request_opts
|
55
|
+
) -> Turbopuffer::Models::NamespaceQueryResponse
|
56
|
+
|
57
|
+
def recall: (
|
58
|
+
?namespace: String,
|
59
|
+
?filters: top,
|
60
|
+
?include_ground_truth: bool,
|
61
|
+
?num: Integer,
|
62
|
+
?queries: ::Array[Float],
|
63
|
+
?top_k: Integer,
|
64
|
+
?request_options: Turbopuffer::request_opts
|
65
|
+
) -> Turbopuffer::Models::NamespaceRecallResponse
|
66
|
+
|
67
|
+
def schema: (
|
68
|
+
?namespace: String,
|
69
|
+
?request_options: Turbopuffer::request_opts
|
70
|
+
) -> Turbopuffer::Models::namespace_schema_response
|
71
|
+
|
72
|
+
def update_schema: (
|
73
|
+
?namespace: String,
|
74
|
+
?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
75
|
+
?request_options: Turbopuffer::request_opts
|
76
|
+
) -> Turbopuffer::Models::namespace_update_schema_response
|
77
|
+
|
78
|
+
def write: (
|
79
|
+
?namespace: String,
|
80
|
+
?copy_from_namespace: String,
|
81
|
+
?delete_by_filter: top,
|
82
|
+
?delete_condition: top,
|
83
|
+
?deletes: ::Array[Turbopuffer::Models::id],
|
84
|
+
?distance_metric: Turbopuffer::Models::distance_metric,
|
85
|
+
?encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
86
|
+
?patch_columns: Turbopuffer::Columns,
|
87
|
+
?patch_condition: top,
|
88
|
+
?patch_rows: ::Array[Turbopuffer::Row],
|
89
|
+
?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
|
90
|
+
?upsert_columns: Turbopuffer::Columns,
|
91
|
+
?upsert_condition: top,
|
92
|
+
?upsert_rows: ::Array[Turbopuffer::Row],
|
93
|
+
?request_options: Turbopuffer::request_opts
|
94
|
+
) -> Turbopuffer::Models::NamespaceWriteResponse
|
95
|
+
|
96
|
+
def initialize: (client: Turbopuffer::Client) -> void
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|