turbopuffer-ruby 0.2.0.pre.alpha.1
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +60 -0
- data/README.md +291 -0
- data/SECURITY.md +27 -0
- data/lib/turbopuffer/client.rb +130 -0
- data/lib/turbopuffer/errors.rb +214 -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 +563 -0
- data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +209 -0
- data/lib/turbopuffer/internal/type/array_of.rb +167 -0
- data/lib/turbopuffer/internal/type/base_model.rb +534 -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 +300 -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 +187 -0
- data/lib/turbopuffer/internal/type/request_parameters.rb +42 -0
- data/lib/turbopuffer/internal/type/union.rb +252 -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/attribute_schema.rb +19 -0
- data/lib/turbopuffer/models/attribute_schema_config.rb +48 -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 +72 -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_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 +35 -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 +51 -0
- data/lib/turbopuffer/models/namespace_query_params.rb +119 -0
- data/lib/turbopuffer/models/namespace_query_response.rb +41 -0
- data/lib/turbopuffer/models/namespace_recall_params.rb +57 -0
- data/lib/turbopuffer/models/namespace_recall_response.rb +39 -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 +63 -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 +38 -0
- data/lib/turbopuffer/models/tokenizer.rb +17 -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 +101 -0
- data/lib/turbopuffer/namespace.rb +22 -0
- data/lib/turbopuffer/request_options.rb +77 -0
- data/lib/turbopuffer/resources/namespaces.rb +311 -0
- data/lib/turbopuffer/version.rb +5 -0
- data/lib/turbopuffer.rb +94 -0
- data/manifest.yaml +15 -0
- data/rbi/turbopuffer/client.rbi +91 -0
- data/rbi/turbopuffer/errors.rbi +178 -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 +298 -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 +162 -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 +121 -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/attribute_schema.rbi +17 -0
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +92 -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 +116 -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_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 +54 -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 +111 -0
- data/rbi/turbopuffer/models/namespace_query_params.rbi +241 -0
- data/rbi/turbopuffer/models/namespace_query_response.rbi +73 -0
- data/rbi/turbopuffer/models/namespace_recall_params.rbi +93 -0
- data/rbi/turbopuffer/models/namespace_recall_response.rbi +59 -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 +106 -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 +22 -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 +64 -0
- data/rbi/turbopuffer/namespace.rbi +8 -0
- data/rbi/turbopuffer/request_options.rbi +59 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +243 -0
- data/rbi/turbopuffer/version.rbi +5 -0
- data/sig/turbopuffer/client.rbs +41 -0
- data/sig/turbopuffer/errors.rbs +110 -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 +62 -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/attribute_schema.rbs +11 -0
- data/sig/turbopuffer/models/attribute_schema_config.rbs +45 -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 +68 -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_hint_cache_warm_params.rbs +25 -0
- data/sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs +17 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +30 -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 +53 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +125 -0
- data/sig/turbopuffer/models/namespace_query_response.rbs +39 -0
- data/sig/turbopuffer/models/namespace_recall_params.rbs +56 -0
- data/sig/turbopuffer/models/namespace_recall_response.rbs +26 -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 +61 -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 +15 -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 +61 -0
- data/sig/turbopuffer/namespace.rbs +5 -0
- data/sig/turbopuffer/request_options.rbs +36 -0
- data/sig/turbopuffer/resources/namespaces.rbs +81 -0
- data/sig/turbopuffer/version.rbs +3 -0
- metadata +251 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceRecallResponse < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(
|
9
|
+
Turbopuffer::Models::NamespaceRecallResponse,
|
10
|
+
Turbopuffer::Internal::AnyHash
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
# The average number of documents retrieved by the approximate nearest neighbor
|
15
|
+
# searches.
|
16
|
+
sig { returns(Float) }
|
17
|
+
attr_accessor :avg_ann_count
|
18
|
+
|
19
|
+
# The average number of documents retrieved by the exhaustive searches.
|
20
|
+
sig { returns(Float) }
|
21
|
+
attr_accessor :avg_exhaustive_count
|
22
|
+
|
23
|
+
# The average recall of the queries.
|
24
|
+
sig { returns(Float) }
|
25
|
+
attr_accessor :avg_recall
|
26
|
+
|
27
|
+
# The response to a successful cache warm request.
|
28
|
+
sig do
|
29
|
+
params(
|
30
|
+
avg_ann_count: Float,
|
31
|
+
avg_exhaustive_count: Float,
|
32
|
+
avg_recall: Float
|
33
|
+
).returns(T.attached_class)
|
34
|
+
end
|
35
|
+
def self.new(
|
36
|
+
# The average number of documents retrieved by the approximate nearest neighbor
|
37
|
+
# searches.
|
38
|
+
avg_ann_count:,
|
39
|
+
# The average number of documents retrieved by the exhaustive searches.
|
40
|
+
avg_exhaustive_count:,
|
41
|
+
# The average recall of the queries.
|
42
|
+
avg_recall:
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
sig do
|
47
|
+
override.returns(
|
48
|
+
{
|
49
|
+
avg_ann_count: Float,
|
50
|
+
avg_exhaustive_count: Float,
|
51
|
+
avg_recall: Float
|
52
|
+
}
|
53
|
+
)
|
54
|
+
end
|
55
|
+
def to_hash
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceSchemaParams < 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::NamespaceSchemaParams,
|
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,28 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module Turbopuffer
|
4
|
+
module Models
|
5
|
+
class NamespaceSummary < Turbopuffer::Internal::Type::BaseModel
|
6
|
+
OrHash =
|
7
|
+
T.type_alias do
|
8
|
+
T.any(Turbopuffer::NamespaceSummary, Turbopuffer::Internal::AnyHash)
|
9
|
+
end
|
10
|
+
|
11
|
+
# The namespace ID.
|
12
|
+
sig { returns(String) }
|
13
|
+
attr_accessor :id
|
14
|
+
|
15
|
+
# A summary of a namespace.
|
16
|
+
sig { params(id: String).returns(T.attached_class) }
|
17
|
+
def self.new(
|
18
|
+
# The namespace ID.
|
19
|
+
id:
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
sig { override.returns({ id: String }) }
|
24
|
+
def to_hash
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -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
|