turbopuffer 0.1.0 → 1.2.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 +205 -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/client_namespaces_params.rb +38 -0
- data/lib/turbopuffer/models/columns.rb +64 -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 +106 -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 +92 -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/client_namespaces_params.rbi +71 -0
- data/rbi/turbopuffer/models/columns.rbi +82 -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 +72 -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/client_namespaces_params.rbs +38 -0
- data/sig/turbopuffer/models/columns.rbs +42 -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 +65 -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 +218 -29
- data/.standard.yml +0 -3
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -10
- data/sig/turbopuffer.rbs +0 -4
@@ -0,0 +1,80 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceUpdateSchemaParams < 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::NamespaceUpdateSchemaParams,
|
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
|
+
# The desired schema for the namespace.
|
24
|
+
sig do
|
25
|
+
returns(
|
26
|
+
T.nilable(
|
27
|
+
T::Hash[Symbol, T.any(String, Turbopuffer::AttributeSchemaConfig)]
|
28
|
+
)
|
29
|
+
)
|
30
|
+
end
|
31
|
+
attr_reader :schema
|
32
|
+
|
33
|
+
sig do
|
34
|
+
params(
|
35
|
+
schema:
|
36
|
+
T::Hash[
|
37
|
+
Symbol,
|
38
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
|
39
|
+
]
|
40
|
+
).void
|
41
|
+
end
|
42
|
+
attr_writer :schema
|
43
|
+
|
44
|
+
sig do
|
45
|
+
params(
|
46
|
+
namespace: String,
|
47
|
+
schema:
|
48
|
+
T::Hash[
|
49
|
+
Symbol,
|
50
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
|
51
|
+
],
|
52
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
53
|
+
).returns(T.attached_class)
|
54
|
+
end
|
55
|
+
def self.new(
|
56
|
+
namespace: nil,
|
57
|
+
# The desired schema for the namespace.
|
58
|
+
schema: nil,
|
59
|
+
request_options: {}
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
sig do
|
64
|
+
override.returns(
|
65
|
+
{
|
66
|
+
namespace: String,
|
67
|
+
schema:
|
68
|
+
T::Hash[
|
69
|
+
Symbol,
|
70
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig)
|
71
|
+
],
|
72
|
+
request_options: Turbopuffer::RequestOptions
|
73
|
+
}
|
74
|
+
)
|
75
|
+
end
|
76
|
+
def to_hash
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,290 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceWriteParams < 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::NamespaceWriteParams,
|
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
|
+
# The namespace to copy documents from.
|
24
|
+
sig { returns(T.nilable(String)) }
|
25
|
+
attr_reader :copy_from_namespace
|
26
|
+
|
27
|
+
sig { params(copy_from_namespace: String).void }
|
28
|
+
attr_writer :copy_from_namespace
|
29
|
+
|
30
|
+
# The filter specifying which documents to delete.
|
31
|
+
sig { returns(T.nilable(T.anything)) }
|
32
|
+
attr_reader :delete_by_filter
|
33
|
+
|
34
|
+
sig { params(delete_by_filter: T.anything).void }
|
35
|
+
attr_writer :delete_by_filter
|
36
|
+
|
37
|
+
# A condition evaluated against the current value of each document targeted by a
|
38
|
+
# delete write. Only documents that pass the condition are deleted.
|
39
|
+
sig { returns(T.nilable(T.anything)) }
|
40
|
+
attr_reader :delete_condition
|
41
|
+
|
42
|
+
sig { params(delete_condition: T.anything).void }
|
43
|
+
attr_writer :delete_condition
|
44
|
+
|
45
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::ID::Variants])) }
|
46
|
+
attr_reader :deletes
|
47
|
+
|
48
|
+
sig { params(deletes: T::Array[Turbopuffer::ID::Variants]).void }
|
49
|
+
attr_writer :deletes
|
50
|
+
|
51
|
+
# A function used to calculate vector similarity.
|
52
|
+
sig { returns(T.nilable(Turbopuffer::DistanceMetric::OrSymbol)) }
|
53
|
+
attr_reader :distance_metric
|
54
|
+
|
55
|
+
sig do
|
56
|
+
params(distance_metric: Turbopuffer::DistanceMetric::OrSymbol).void
|
57
|
+
end
|
58
|
+
attr_writer :distance_metric
|
59
|
+
|
60
|
+
# The encryption configuration for a namespace.
|
61
|
+
sig { returns(T.nilable(Turbopuffer::NamespaceWriteParams::Encryption)) }
|
62
|
+
attr_reader :encryption
|
63
|
+
|
64
|
+
sig do
|
65
|
+
params(
|
66
|
+
encryption: Turbopuffer::NamespaceWriteParams::Encryption::OrHash
|
67
|
+
).void
|
68
|
+
end
|
69
|
+
attr_writer :encryption
|
70
|
+
|
71
|
+
# A list of documents in columnar format. Each key is a column name, mapped to an
|
72
|
+
# array of values for that column.
|
73
|
+
sig { returns(T.nilable(Turbopuffer::Columns)) }
|
74
|
+
attr_reader :patch_columns
|
75
|
+
|
76
|
+
sig { params(patch_columns: Turbopuffer::Columns::OrHash).void }
|
77
|
+
attr_writer :patch_columns
|
78
|
+
|
79
|
+
# A condition evaluated against the current value of each document targeted by a
|
80
|
+
# patch write. Only documents that pass the condition are patched.
|
81
|
+
sig { returns(T.nilable(T.anything)) }
|
82
|
+
attr_reader :patch_condition
|
83
|
+
|
84
|
+
sig { params(patch_condition: T.anything).void }
|
85
|
+
attr_writer :patch_condition
|
86
|
+
|
87
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::Row])) }
|
88
|
+
attr_reader :patch_rows
|
89
|
+
|
90
|
+
sig { params(patch_rows: T::Array[Turbopuffer::Row::OrHash]).void }
|
91
|
+
attr_writer :patch_rows
|
92
|
+
|
93
|
+
# The schema of the attributes attached to the documents.
|
94
|
+
sig do
|
95
|
+
returns(
|
96
|
+
T.nilable(
|
97
|
+
T::Hash[Symbol, T.any(String, Turbopuffer::AttributeSchemaConfig)]
|
98
|
+
)
|
99
|
+
)
|
100
|
+
end
|
101
|
+
attr_reader :schema
|
102
|
+
|
103
|
+
sig do
|
104
|
+
params(
|
105
|
+
schema:
|
106
|
+
T::Hash[
|
107
|
+
Symbol,
|
108
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
|
109
|
+
]
|
110
|
+
).void
|
111
|
+
end
|
112
|
+
attr_writer :schema
|
113
|
+
|
114
|
+
# A list of documents in columnar format. Each key is a column name, mapped to an
|
115
|
+
# array of values for that column.
|
116
|
+
sig { returns(T.nilable(Turbopuffer::Columns)) }
|
117
|
+
attr_reader :upsert_columns
|
118
|
+
|
119
|
+
sig { params(upsert_columns: Turbopuffer::Columns::OrHash).void }
|
120
|
+
attr_writer :upsert_columns
|
121
|
+
|
122
|
+
# A condition evaluated against the current value of each document targeted by an
|
123
|
+
# upsert write. Only documents that pass the condition are upserted.
|
124
|
+
sig { returns(T.nilable(T.anything)) }
|
125
|
+
attr_reader :upsert_condition
|
126
|
+
|
127
|
+
sig { params(upsert_condition: T.anything).void }
|
128
|
+
attr_writer :upsert_condition
|
129
|
+
|
130
|
+
sig { returns(T.nilable(T::Array[Turbopuffer::Row])) }
|
131
|
+
attr_reader :upsert_rows
|
132
|
+
|
133
|
+
sig { params(upsert_rows: T::Array[Turbopuffer::Row::OrHash]).void }
|
134
|
+
attr_writer :upsert_rows
|
135
|
+
|
136
|
+
sig do
|
137
|
+
params(
|
138
|
+
namespace: String,
|
139
|
+
copy_from_namespace: String,
|
140
|
+
delete_by_filter: T.anything,
|
141
|
+
delete_condition: T.anything,
|
142
|
+
deletes: T::Array[Turbopuffer::ID::Variants],
|
143
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
144
|
+
encryption: Turbopuffer::NamespaceWriteParams::Encryption::OrHash,
|
145
|
+
patch_columns: Turbopuffer::Columns::OrHash,
|
146
|
+
patch_condition: T.anything,
|
147
|
+
patch_rows: T::Array[Turbopuffer::Row::OrHash],
|
148
|
+
schema:
|
149
|
+
T::Hash[
|
150
|
+
Symbol,
|
151
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig::OrHash)
|
152
|
+
],
|
153
|
+
upsert_columns: Turbopuffer::Columns::OrHash,
|
154
|
+
upsert_condition: T.anything,
|
155
|
+
upsert_rows: T::Array[Turbopuffer::Row::OrHash],
|
156
|
+
request_options: Turbopuffer::RequestOptions::OrHash
|
157
|
+
).returns(T.attached_class)
|
158
|
+
end
|
159
|
+
def self.new(
|
160
|
+
namespace: nil,
|
161
|
+
# The namespace to copy documents from.
|
162
|
+
copy_from_namespace: nil,
|
163
|
+
# The filter specifying which documents to delete.
|
164
|
+
delete_by_filter: nil,
|
165
|
+
# A condition evaluated against the current value of each document targeted by a
|
166
|
+
# delete write. Only documents that pass the condition are deleted.
|
167
|
+
delete_condition: nil,
|
168
|
+
deletes: nil,
|
169
|
+
# A function used to calculate vector similarity.
|
170
|
+
distance_metric: nil,
|
171
|
+
# The encryption configuration for a namespace.
|
172
|
+
encryption: nil,
|
173
|
+
# A list of documents in columnar format. Each key is a column name, mapped to an
|
174
|
+
# array of values for that column.
|
175
|
+
patch_columns: nil,
|
176
|
+
# A condition evaluated against the current value of each document targeted by a
|
177
|
+
# patch write. Only documents that pass the condition are patched.
|
178
|
+
patch_condition: nil,
|
179
|
+
patch_rows: nil,
|
180
|
+
# The schema of the attributes attached to the documents.
|
181
|
+
schema: nil,
|
182
|
+
# A list of documents in columnar format. Each key is a column name, mapped to an
|
183
|
+
# array of values for that column.
|
184
|
+
upsert_columns: nil,
|
185
|
+
# A condition evaluated against the current value of each document targeted by an
|
186
|
+
# upsert write. Only documents that pass the condition are upserted.
|
187
|
+
upsert_condition: nil,
|
188
|
+
upsert_rows: nil,
|
189
|
+
request_options: {}
|
190
|
+
)
|
191
|
+
end
|
192
|
+
|
193
|
+
sig do
|
194
|
+
override.returns(
|
195
|
+
{
|
196
|
+
namespace: String,
|
197
|
+
copy_from_namespace: String,
|
198
|
+
delete_by_filter: T.anything,
|
199
|
+
delete_condition: T.anything,
|
200
|
+
deletes: T::Array[Turbopuffer::ID::Variants],
|
201
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
202
|
+
encryption: Turbopuffer::NamespaceWriteParams::Encryption,
|
203
|
+
patch_columns: Turbopuffer::Columns,
|
204
|
+
patch_condition: T.anything,
|
205
|
+
patch_rows: T::Array[Turbopuffer::Row],
|
206
|
+
schema:
|
207
|
+
T::Hash[
|
208
|
+
Symbol,
|
209
|
+
T.any(String, Turbopuffer::AttributeSchemaConfig)
|
210
|
+
],
|
211
|
+
upsert_columns: Turbopuffer::Columns,
|
212
|
+
upsert_condition: T.anything,
|
213
|
+
upsert_rows: T::Array[Turbopuffer::Row],
|
214
|
+
request_options: Turbopuffer::RequestOptions
|
215
|
+
}
|
216
|
+
)
|
217
|
+
end
|
218
|
+
def to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
class Encryption < Turbopuffer::Internal::Type::BaseModel
|
222
|
+
OrHash =
|
223
|
+
T.type_alias do
|
224
|
+
T.any(
|
225
|
+
Turbopuffer::NamespaceWriteParams::Encryption,
|
226
|
+
Turbopuffer::Internal::AnyHash
|
227
|
+
)
|
228
|
+
end
|
229
|
+
|
230
|
+
sig do
|
231
|
+
returns(
|
232
|
+
T.nilable(Turbopuffer::NamespaceWriteParams::Encryption::Cmek)
|
233
|
+
)
|
234
|
+
end
|
235
|
+
attr_reader :cmek
|
236
|
+
|
237
|
+
sig do
|
238
|
+
params(
|
239
|
+
cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek::OrHash
|
240
|
+
).void
|
241
|
+
end
|
242
|
+
attr_writer :cmek
|
243
|
+
|
244
|
+
# The encryption configuration for a namespace.
|
245
|
+
sig do
|
246
|
+
params(
|
247
|
+
cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek::OrHash
|
248
|
+
).returns(T.attached_class)
|
249
|
+
end
|
250
|
+
def self.new(cmek: nil)
|
251
|
+
end
|
252
|
+
|
253
|
+
sig do
|
254
|
+
override.returns(
|
255
|
+
{ cmek: Turbopuffer::NamespaceWriteParams::Encryption::Cmek }
|
256
|
+
)
|
257
|
+
end
|
258
|
+
def to_hash
|
259
|
+
end
|
260
|
+
|
261
|
+
class Cmek < Turbopuffer::Internal::Type::BaseModel
|
262
|
+
OrHash =
|
263
|
+
T.type_alias do
|
264
|
+
T.any(
|
265
|
+
Turbopuffer::NamespaceWriteParams::Encryption::Cmek,
|
266
|
+
Turbopuffer::Internal::AnyHash
|
267
|
+
)
|
268
|
+
end
|
269
|
+
|
270
|
+
# The identifier of the CMEK key to use for encryption. For GCP, the
|
271
|
+
# fully-qualified resource name of the key. For AWS, the ARN of the key.
|
272
|
+
sig { returns(String) }
|
273
|
+
attr_accessor :key_name
|
274
|
+
|
275
|
+
sig { params(key_name: String).returns(T.attached_class) }
|
276
|
+
def self.new(
|
277
|
+
# The identifier of the CMEK key to use for encryption. For GCP, the
|
278
|
+
# fully-qualified resource name of the key. For AWS, the ARN of the key.
|
279
|
+
key_name:
|
280
|
+
)
|
281
|
+
end
|
282
|
+
|
283
|
+
sig { override.returns({ key_name: String }) }
|
284
|
+
def to_hash
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceWriteResponse < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Turbopuffer::Models::NamespaceWriteResponse,
|
10
|
+
Turbopuffer::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# The billing information for a write request.
|
15
|
+
sig { returns(Turbopuffer::WriteBilling) }
|
16
|
+
attr_reader :billing
|
17
|
+
|
18
|
+
sig { params(billing: Turbopuffer::WriteBilling::OrHash).void }
|
19
|
+
attr_writer :billing
|
20
|
+
|
21
|
+
# A message describing the result of the write request.
|
22
|
+
sig { returns(String) }
|
23
|
+
attr_accessor :message
|
24
|
+
|
25
|
+
# The number of rows affected by the write request.
|
26
|
+
sig { returns(Integer) }
|
27
|
+
attr_accessor :rows_affected
|
28
|
+
|
29
|
+
# The status of the request.
|
30
|
+
sig { returns(Symbol) }
|
31
|
+
attr_accessor :status
|
32
|
+
|
33
|
+
# The number of rows deleted by the write request.
|
34
|
+
sig { returns(T.nilable(Integer)) }
|
35
|
+
attr_reader :rows_deleted
|
36
|
+
|
37
|
+
sig { params(rows_deleted: Integer).void }
|
38
|
+
attr_writer :rows_deleted
|
39
|
+
|
40
|
+
# The number of rows patched by the write request.
|
41
|
+
sig { returns(T.nilable(Integer)) }
|
42
|
+
attr_reader :rows_patched
|
43
|
+
|
44
|
+
sig { params(rows_patched: Integer).void }
|
45
|
+
attr_writer :rows_patched
|
46
|
+
|
47
|
+
# The number of rows upserted by the write request.
|
48
|
+
sig { returns(T.nilable(Integer)) }
|
49
|
+
attr_reader :rows_upserted
|
50
|
+
|
51
|
+
sig { params(rows_upserted: Integer).void }
|
52
|
+
attr_writer :rows_upserted
|
53
|
+
|
54
|
+
# The response to a successful write request.
|
55
|
+
sig do
|
56
|
+
params(
|
57
|
+
billing: Turbopuffer::WriteBilling::OrHash,
|
58
|
+
message: String,
|
59
|
+
rows_affected: Integer,
|
60
|
+
rows_deleted: Integer,
|
61
|
+
rows_patched: Integer,
|
62
|
+
rows_upserted: Integer,
|
63
|
+
status: Symbol
|
64
|
+
).returns(T.attached_class)
|
65
|
+
end
|
66
|
+
def self.new(
|
67
|
+
# The billing information for a write request.
|
68
|
+
billing:,
|
69
|
+
# A message describing the result of the write request.
|
70
|
+
message:,
|
71
|
+
# The number of rows affected by the write request.
|
72
|
+
rows_affected:,
|
73
|
+
# The number of rows deleted by the write request.
|
74
|
+
rows_deleted: nil,
|
75
|
+
# The number of rows patched by the write request.
|
76
|
+
rows_patched: nil,
|
77
|
+
# The number of rows upserted by the write request.
|
78
|
+
rows_upserted: nil,
|
79
|
+
# The status of the request.
|
80
|
+
status: :OK
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
sig do
|
85
|
+
override.returns(
|
86
|
+
{
|
87
|
+
billing: Turbopuffer::WriteBilling,
|
88
|
+
message: String,
|
89
|
+
rows_affected: Integer,
|
90
|
+
status: Symbol,
|
91
|
+
rows_deleted: Integer,
|
92
|
+
rows_patched: Integer,
|
93
|
+
rows_upserted: Integer
|
94
|
+
}
|
95
|
+
)
|
96
|
+
end
|
97
|
+
def to_hash
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class Query < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Turbopuffer::Query, Turbopuffer::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
# Aggregations to compute over all documents in the namespace that match the
|
12
|
+
# filters.
|
13
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
14
|
+
attr_reader :aggregate_by
|
15
|
+
|
16
|
+
sig { params(aggregate_by: T::Hash[Symbol, T.anything]).void }
|
17
|
+
attr_writer :aggregate_by
|
18
|
+
|
19
|
+
# A function used to calculate vector similarity.
|
20
|
+
sig { returns(T.nilable(Turbopuffer::DistanceMetric::OrSymbol)) }
|
21
|
+
attr_reader :distance_metric
|
22
|
+
|
23
|
+
sig do
|
24
|
+
params(distance_metric: Turbopuffer::DistanceMetric::OrSymbol).void
|
25
|
+
end
|
26
|
+
attr_writer :distance_metric
|
27
|
+
|
28
|
+
# List of attribute names to exclude from the response. All other attributes will
|
29
|
+
# be included in the response.
|
30
|
+
sig { returns(T.nilable(T::Array[String])) }
|
31
|
+
attr_reader :exclude_attributes
|
32
|
+
|
33
|
+
sig { params(exclude_attributes: T::Array[String]).void }
|
34
|
+
attr_writer :exclude_attributes
|
35
|
+
|
36
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
37
|
+
# WHERE clause.
|
38
|
+
sig { returns(T.nilable(T.anything)) }
|
39
|
+
attr_reader :filters
|
40
|
+
|
41
|
+
sig { params(filters: T.anything).void }
|
42
|
+
attr_writer :filters
|
43
|
+
|
44
|
+
# Groups documents by the specified attributes (the "group key") before computing
|
45
|
+
# aggregates. Aggregates are computed separately for each group.
|
46
|
+
sig { returns(T.nilable(T::Array[String])) }
|
47
|
+
attr_reader :group_by
|
48
|
+
|
49
|
+
sig { params(group_by: T::Array[String]).void }
|
50
|
+
attr_writer :group_by
|
51
|
+
|
52
|
+
# Whether to include attributes in the response.
|
53
|
+
sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
|
54
|
+
attr_reader :include_attributes
|
55
|
+
|
56
|
+
sig do
|
57
|
+
params(
|
58
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants
|
59
|
+
).void
|
60
|
+
end
|
61
|
+
attr_writer :include_attributes
|
62
|
+
|
63
|
+
# How to rank the documents in the namespace.
|
64
|
+
sig { returns(T.nilable(T.anything)) }
|
65
|
+
attr_reader :rank_by
|
66
|
+
|
67
|
+
sig { params(rank_by: T.anything).void }
|
68
|
+
attr_writer :rank_by
|
69
|
+
|
70
|
+
# The number of results to return.
|
71
|
+
sig { returns(T.nilable(Integer)) }
|
72
|
+
attr_reader :top_k
|
73
|
+
|
74
|
+
sig { params(top_k: Integer).void }
|
75
|
+
attr_writer :top_k
|
76
|
+
|
77
|
+
# Query, filter, full-text search and vector search documents.
|
78
|
+
sig do
|
79
|
+
params(
|
80
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
81
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
82
|
+
exclude_attributes: T::Array[String],
|
83
|
+
filters: T.anything,
|
84
|
+
group_by: T::Array[String],
|
85
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
86
|
+
rank_by: T.anything,
|
87
|
+
top_k: Integer
|
88
|
+
).returns(T.attached_class)
|
89
|
+
end
|
90
|
+
def self.new(
|
91
|
+
# Aggregations to compute over all documents in the namespace that match the
|
92
|
+
# filters.
|
93
|
+
aggregate_by: nil,
|
94
|
+
# A function used to calculate vector similarity.
|
95
|
+
distance_metric: nil,
|
96
|
+
# List of attribute names to exclude from the response. All other attributes will
|
97
|
+
# be included in the response.
|
98
|
+
exclude_attributes: nil,
|
99
|
+
# Exact filters for attributes to refine search results for. Think of it as a SQL
|
100
|
+
# WHERE clause.
|
101
|
+
filters: nil,
|
102
|
+
# Groups documents by the specified attributes (the "group key") before computing
|
103
|
+
# aggregates. Aggregates are computed separately for each group.
|
104
|
+
group_by: nil,
|
105
|
+
# Whether to include attributes in the response.
|
106
|
+
include_attributes: nil,
|
107
|
+
# How to rank the documents in the namespace.
|
108
|
+
rank_by: nil,
|
109
|
+
# The number of results to return.
|
110
|
+
top_k: nil
|
111
|
+
)
|
112
|
+
end
|
113
|
+
|
114
|
+
sig do
|
115
|
+
override.returns(
|
116
|
+
{
|
117
|
+
aggregate_by: T::Hash[Symbol, T.anything],
|
118
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
119
|
+
exclude_attributes: T::Array[String],
|
120
|
+
filters: T.anything,
|
121
|
+
group_by: T::Array[String],
|
122
|
+
include_attributes: Turbopuffer::IncludeAttributes::Variants,
|
123
|
+
rank_by: T.anything,
|
124
|
+
top_k: Integer
|
125
|
+
}
|
126
|
+
)
|
127
|
+
end
|
128
|
+
def to_hash
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class QueryBilling < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Turbopuffer::QueryBilling, Turbopuffer::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
# The number of billable logical bytes queried from the namespace.
|
12
|
+
sig { returns(Integer) }
|
13
|
+
attr_accessor :billable_logical_bytes_queried
|
14
|
+
|
15
|
+
# The number of billable logical bytes returned from the query.
|
16
|
+
sig { returns(Integer) }
|
17
|
+
attr_accessor :billable_logical_bytes_returned
|
18
|
+
|
19
|
+
# The billing information for a query.
|
20
|
+
sig do
|
21
|
+
params(
|
22
|
+
billable_logical_bytes_queried: Integer,
|
23
|
+
billable_logical_bytes_returned: Integer
|
24
|
+
).returns(T.attached_class)
|
25
|
+
end
|
26
|
+
def self.new(
|
27
|
+
# The number of billable logical bytes queried from the namespace.
|
28
|
+
billable_logical_bytes_queried:,
|
29
|
+
# The number of billable logical bytes returned from the query.
|
30
|
+
billable_logical_bytes_returned:
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
sig do
|
35
|
+
override.returns(
|
36
|
+
{
|
37
|
+
billable_logical_bytes_queried: Integer,
|
38
|
+
billable_logical_bytes_returned: Integer
|
39
|
+
}
|
40
|
+
)
|
41
|
+
end
|
42
|
+
def to_hash
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|