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.
Files changed (207) hide show
  1. checksums.yaml +4 -4
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +205 -0
  4. data/README.md +270 -40
  5. data/SECURITY.md +27 -0
  6. data/lib/turbopuffer/client.rb +122 -16
  7. data/lib/turbopuffer/errors.rb +228 -0
  8. data/lib/turbopuffer/file_part.rb +55 -0
  9. data/lib/turbopuffer/internal/namespace_page.rb +86 -0
  10. data/lib/turbopuffer/internal/transport/base_client.rb +567 -0
  11. data/lib/turbopuffer/internal/transport/pooled_net_requester.rb +201 -0
  12. data/lib/turbopuffer/internal/type/array_of.rb +168 -0
  13. data/lib/turbopuffer/internal/type/base_model.rb +529 -0
  14. data/lib/turbopuffer/internal/type/base_page.rb +55 -0
  15. data/lib/turbopuffer/internal/type/boolean.rb +77 -0
  16. data/lib/turbopuffer/internal/type/converter.rb +327 -0
  17. data/lib/turbopuffer/internal/type/enum.rb +152 -0
  18. data/lib/turbopuffer/internal/type/file_input.rb +108 -0
  19. data/lib/turbopuffer/internal/type/hash_of.rb +188 -0
  20. data/lib/turbopuffer/internal/type/request_parameters.rb +42 -0
  21. data/lib/turbopuffer/internal/type/union.rb +254 -0
  22. data/lib/turbopuffer/internal/type/unknown.rb +81 -0
  23. data/lib/turbopuffer/internal/util.rb +914 -0
  24. data/lib/turbopuffer/internal.rb +20 -0
  25. data/lib/turbopuffer/models/aggregation_group.rb +8 -0
  26. data/lib/turbopuffer/models/attribute_schema.rb +19 -0
  27. data/lib/turbopuffer/models/attribute_schema_config.rb +56 -0
  28. data/lib/turbopuffer/models/attribute_type.rb +7 -0
  29. data/lib/turbopuffer/models/client_namespaces_params.rb +38 -0
  30. data/lib/turbopuffer/models/columns.rb +64 -0
  31. data/lib/turbopuffer/models/distance_metric.rb +19 -0
  32. data/lib/turbopuffer/models/full_text_search.rb +20 -0
  33. data/lib/turbopuffer/models/full_text_search_config.rb +83 -0
  34. data/lib/turbopuffer/models/id.rb +19 -0
  35. data/lib/turbopuffer/models/include_attributes.rb +22 -0
  36. data/lib/turbopuffer/models/language.rb +32 -0
  37. data/lib/turbopuffer/models/namespace_delete_all_params.rb +20 -0
  38. data/lib/turbopuffer/models/namespace_delete_all_response.rb +19 -0
  39. data/lib/turbopuffer/models/namespace_explain_query_params.rb +137 -0
  40. data/lib/turbopuffer/models/namespace_explain_query_response.rb +19 -0
  41. data/lib/turbopuffer/models/namespace_hint_cache_warm_params.rb +20 -0
  42. data/lib/turbopuffer/models/namespace_hint_cache_warm_response.rb +26 -0
  43. data/lib/turbopuffer/models/namespace_metadata.rb +43 -0
  44. data/lib/turbopuffer/models/namespace_metadata_params.rb +20 -0
  45. data/lib/turbopuffer/models/namespace_multi_query_params.rb +73 -0
  46. data/lib/turbopuffer/models/namespace_multi_query_response.rb +58 -0
  47. data/lib/turbopuffer/models/namespace_query_params.rb +137 -0
  48. data/lib/turbopuffer/models/namespace_query_response.rb +49 -0
  49. data/lib/turbopuffer/models/namespace_recall_params.rb +66 -0
  50. data/lib/turbopuffer/models/namespace_recall_response.rb +68 -0
  51. data/lib/turbopuffer/models/namespace_schema_params.rb +20 -0
  52. data/lib/turbopuffer/models/namespace_schema_response.rb +8 -0
  53. data/lib/turbopuffer/models/namespace_summary.rb +19 -0
  54. data/lib/turbopuffer/models/namespace_update_schema_params.rb +29 -0
  55. data/lib/turbopuffer/models/namespace_update_schema_response.rb +9 -0
  56. data/lib/turbopuffer/models/namespace_write_params.rb +158 -0
  57. data/lib/turbopuffer/models/namespace_write_response.rb +67 -0
  58. data/lib/turbopuffer/models/query.rb +81 -0
  59. data/lib/turbopuffer/models/query_billing.rb +26 -0
  60. data/lib/turbopuffer/models/query_performance.rb +63 -0
  61. data/lib/turbopuffer/models/row.rb +46 -0
  62. data/lib/turbopuffer/models/tokenizer.rb +19 -0
  63. data/lib/turbopuffer/models/vector.rb +22 -0
  64. data/lib/turbopuffer/models/vector_encoding.rb +16 -0
  65. data/lib/turbopuffer/models/write_billing.rb +26 -0
  66. data/lib/turbopuffer/models.rb +106 -0
  67. data/lib/turbopuffer/namespace.rb +14 -50
  68. data/lib/turbopuffer/request_options.rb +77 -0
  69. data/lib/turbopuffer/resources/namespaces.rb +366 -0
  70. data/lib/turbopuffer/version.rb +1 -1
  71. data/lib/turbopuffer.rb +92 -4
  72. data/manifest.yaml +15 -0
  73. data/rbi/turbopuffer/client.rbi +91 -0
  74. data/rbi/turbopuffer/errors.rbi +205 -0
  75. data/rbi/turbopuffer/file_part.rbi +37 -0
  76. data/rbi/turbopuffer/internal/namespace_page.rbi +22 -0
  77. data/rbi/turbopuffer/internal/transport/base_client.rbi +297 -0
  78. data/rbi/turbopuffer/internal/transport/pooled_net_requester.rbi +80 -0
  79. data/rbi/turbopuffer/internal/type/array_of.rbi +104 -0
  80. data/rbi/turbopuffer/internal/type/base_model.rbi +304 -0
  81. data/rbi/turbopuffer/internal/type/base_page.rbi +43 -0
  82. data/rbi/turbopuffer/internal/type/boolean.rbi +58 -0
  83. data/rbi/turbopuffer/internal/type/converter.rbi +216 -0
  84. data/rbi/turbopuffer/internal/type/enum.rbi +82 -0
  85. data/rbi/turbopuffer/internal/type/file_input.rbi +59 -0
  86. data/rbi/turbopuffer/internal/type/hash_of.rbi +104 -0
  87. data/rbi/turbopuffer/internal/type/request_parameters.rbi +31 -0
  88. data/rbi/turbopuffer/internal/type/union.rbi +128 -0
  89. data/rbi/turbopuffer/internal/type/unknown.rbi +58 -0
  90. data/rbi/turbopuffer/internal/util.rbi +487 -0
  91. data/rbi/turbopuffer/internal.rbi +18 -0
  92. data/rbi/turbopuffer/models/aggregation_group.rbi +13 -0
  93. data/rbi/turbopuffer/models/attribute_schema.rbi +17 -0
  94. data/rbi/turbopuffer/models/attribute_schema_config.rbi +103 -0
  95. data/rbi/turbopuffer/models/attribute_type.rbi +7 -0
  96. data/rbi/turbopuffer/models/client_namespaces_params.rbi +71 -0
  97. data/rbi/turbopuffer/models/columns.rbi +82 -0
  98. data/rbi/turbopuffer/models/distance_metric.rbi +27 -0
  99. data/rbi/turbopuffer/models/full_text_search.rbi +19 -0
  100. data/rbi/turbopuffer/models/full_text_search_config.rbi +133 -0
  101. data/rbi/turbopuffer/models/id.rbi +16 -0
  102. data/rbi/turbopuffer/models/include_attributes.rbi +24 -0
  103. data/rbi/turbopuffer/models/language.rbi +36 -0
  104. data/rbi/turbopuffer/models/namespace_delete_all_params.rbi +41 -0
  105. data/rbi/turbopuffer/models/namespace_delete_all_response.rbi +31 -0
  106. data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +273 -0
  107. data/rbi/turbopuffer/models/namespace_explain_query_response.rbi +34 -0
  108. data/rbi/turbopuffer/models/namespace_hint_cache_warm_params.rbi +41 -0
  109. data/rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi +38 -0
  110. data/rbi/turbopuffer/models/namespace_metadata.rbi +62 -0
  111. data/rbi/turbopuffer/models/namespace_metadata_params.rbi +41 -0
  112. data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +175 -0
  113. data/rbi/turbopuffer/models/namespace_multi_query_response.rbi +121 -0
  114. data/rbi/turbopuffer/models/namespace_query_params.rbi +267 -0
  115. data/rbi/turbopuffer/models/namespace_query_response.rbi +84 -0
  116. data/rbi/turbopuffer/models/namespace_recall_params.rbi +106 -0
  117. data/rbi/turbopuffer/models/namespace_recall_response.rbi +134 -0
  118. data/rbi/turbopuffer/models/namespace_schema_params.rbi +41 -0
  119. data/rbi/turbopuffer/models/namespace_schema_response.rbi +11 -0
  120. data/rbi/turbopuffer/models/namespace_summary.rbi +28 -0
  121. data/rbi/turbopuffer/models/namespace_update_schema_params.rbi +80 -0
  122. data/rbi/turbopuffer/models/namespace_update_schema_response.rbi +11 -0
  123. data/rbi/turbopuffer/models/namespace_write_params.rbi +290 -0
  124. data/rbi/turbopuffer/models/namespace_write_response.rbi +101 -0
  125. data/rbi/turbopuffer/models/query.rbi +132 -0
  126. data/rbi/turbopuffer/models/query_billing.rbi +46 -0
  127. data/rbi/turbopuffer/models/query_performance.rbi +82 -0
  128. data/rbi/turbopuffer/models/row.rbi +47 -0
  129. data/rbi/turbopuffer/models/tokenizer.rbi +24 -0
  130. data/rbi/turbopuffer/models/vector.rbi +22 -0
  131. data/rbi/turbopuffer/models/vector_encoding.rbi +22 -0
  132. data/rbi/turbopuffer/models/write_billing.rbi +49 -0
  133. data/rbi/turbopuffer/models.rbi +72 -0
  134. data/rbi/turbopuffer/namespace.rbi +8 -0
  135. data/rbi/turbopuffer/request_options.rbi +59 -0
  136. data/rbi/turbopuffer/resources/namespaces.rbi +304 -0
  137. data/rbi/turbopuffer/version.rbi +5 -0
  138. data/sig/turbopuffer/client.rbs +41 -0
  139. data/sig/turbopuffer/errors.rbs +117 -0
  140. data/sig/turbopuffer/file_part.rbs +21 -0
  141. data/sig/turbopuffer/internal/namespace_page.rbs +13 -0
  142. data/sig/turbopuffer/internal/transport/base_client.rbs +131 -0
  143. data/sig/turbopuffer/internal/transport/pooled_net_requester.rbs +45 -0
  144. data/sig/turbopuffer/internal/type/array_of.rbs +48 -0
  145. data/sig/turbopuffer/internal/type/base_model.rbs +102 -0
  146. data/sig/turbopuffer/internal/type/base_page.rbs +24 -0
  147. data/sig/turbopuffer/internal/type/boolean.rbs +26 -0
  148. data/sig/turbopuffer/internal/type/converter.rbs +79 -0
  149. data/sig/turbopuffer/internal/type/enum.rbs +32 -0
  150. data/sig/turbopuffer/internal/type/file_input.rbs +25 -0
  151. data/sig/turbopuffer/internal/type/hash_of.rbs +48 -0
  152. data/sig/turbopuffer/internal/type/request_parameters.rbs +19 -0
  153. data/sig/turbopuffer/internal/type/union.rbs +52 -0
  154. data/sig/turbopuffer/internal/type/unknown.rbs +26 -0
  155. data/sig/turbopuffer/internal/util.rbs +185 -0
  156. data/sig/turbopuffer/internal.rbs +9 -0
  157. data/sig/turbopuffer/models/aggregation_group.rbs +7 -0
  158. data/sig/turbopuffer/models/attribute_schema.rbs +11 -0
  159. data/sig/turbopuffer/models/attribute_schema_config.rbs +52 -0
  160. data/sig/turbopuffer/models/attribute_type.rbs +5 -0
  161. data/sig/turbopuffer/models/client_namespaces_params.rbs +38 -0
  162. data/sig/turbopuffer/models/columns.rbs +42 -0
  163. data/sig/turbopuffer/models/distance_metric.rbs +17 -0
  164. data/sig/turbopuffer/models/full_text_search.rbs +11 -0
  165. data/sig/turbopuffer/models/full_text_search_config.rbs +75 -0
  166. data/sig/turbopuffer/models/id.rbs +11 -0
  167. data/sig/turbopuffer/models/include_attributes.rbs +13 -0
  168. data/sig/turbopuffer/models/language.rbs +48 -0
  169. data/sig/turbopuffer/models/namespace_delete_all_params.rbs +25 -0
  170. data/sig/turbopuffer/models/namespace_delete_all_response.rbs +13 -0
  171. data/sig/turbopuffer/models/namespace_explain_query_params.rbs +141 -0
  172. data/sig/turbopuffer/models/namespace_explain_query_response.rbs +15 -0
  173. data/sig/turbopuffer/models/namespace_hint_cache_warm_params.rbs +25 -0
  174. data/sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs +18 -0
  175. data/sig/turbopuffer/models/namespace_metadata.rbs +35 -0
  176. data/sig/turbopuffer/models/namespace_metadata_params.rbs +25 -0
  177. data/sig/turbopuffer/models/namespace_multi_query_params.rbs +86 -0
  178. data/sig/turbopuffer/models/namespace_multi_query_response.rbs +65 -0
  179. data/sig/turbopuffer/models/namespace_query_params.rbs +139 -0
  180. data/sig/turbopuffer/models/namespace_query_response.rbs +48 -0
  181. data/sig/turbopuffer/models/namespace_recall_params.rbs +63 -0
  182. data/sig/turbopuffer/models/namespace_recall_response.rbs +61 -0
  183. data/sig/turbopuffer/models/namespace_schema_params.rbs +25 -0
  184. data/sig/turbopuffer/models/namespace_schema_response.rbs +8 -0
  185. data/sig/turbopuffer/models/namespace_summary.rbs +13 -0
  186. data/sig/turbopuffer/models/namespace_update_schema_params.rbs +37 -0
  187. data/sig/turbopuffer/models/namespace_update_schema_response.rbs +8 -0
  188. data/sig/turbopuffer/models/namespace_write_params.rbs +156 -0
  189. data/sig/turbopuffer/models/namespace_write_response.rbs +56 -0
  190. data/sig/turbopuffer/models/query.rbs +75 -0
  191. data/sig/turbopuffer/models/query_billing.rbs +25 -0
  192. data/sig/turbopuffer/models/query_performance.rbs +45 -0
  193. data/sig/turbopuffer/models/row.rbs +24 -0
  194. data/sig/turbopuffer/models/tokenizer.rbs +16 -0
  195. data/sig/turbopuffer/models/vector.rbs +13 -0
  196. data/sig/turbopuffer/models/vector_encoding.rbs +14 -0
  197. data/sig/turbopuffer/models/write_billing.rbs +27 -0
  198. data/sig/turbopuffer/models.rbs +65 -0
  199. data/sig/turbopuffer/namespace.rbs +5 -0
  200. data/sig/turbopuffer/request_options.rbs +36 -0
  201. data/sig/turbopuffer/resources/namespaces.rbs +99 -0
  202. data/sig/turbopuffer/version.rbs +3 -0
  203. metadata +218 -29
  204. data/.standard.yml +0 -3
  205. data/LICENSE.txt +0 -21
  206. data/Rakefile +0 -10
  207. data/sig/turbopuffer.rbs +0 -4
@@ -0,0 +1,63 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_recall_params =
4
+ {
5
+ namespace: String,
6
+ filters: top,
7
+ include_ground_truth: bool,
8
+ num: Integer,
9
+ queries: ::Array[Float],
10
+ top_k: Integer
11
+ }
12
+ & Turbopuffer::Internal::Type::request_parameters
13
+
14
+ class NamespaceRecallParams < Turbopuffer::Internal::Type::BaseModel
15
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
16
+ include Turbopuffer::Internal::Type::RequestParameters
17
+
18
+ attr_reader namespace: String?
19
+
20
+ def namespace=: (String) -> String
21
+
22
+ attr_reader filters: top?
23
+
24
+ def filters=: (top) -> top
25
+
26
+ attr_reader include_ground_truth: bool?
27
+
28
+ def include_ground_truth=: (bool) -> bool
29
+
30
+ attr_reader num: Integer?
31
+
32
+ def num=: (Integer) -> Integer
33
+
34
+ attr_reader queries: ::Array[Float]?
35
+
36
+ def queries=: (::Array[Float]) -> ::Array[Float]
37
+
38
+ attr_reader top_k: Integer?
39
+
40
+ def top_k=: (Integer) -> Integer
41
+
42
+ def initialize: (
43
+ ?namespace: String,
44
+ ?filters: top,
45
+ ?include_ground_truth: bool,
46
+ ?num: Integer,
47
+ ?queries: ::Array[Float],
48
+ ?top_k: Integer,
49
+ ?request_options: Turbopuffer::request_opts
50
+ ) -> void
51
+
52
+ def to_hash: -> {
53
+ namespace: String,
54
+ filters: top,
55
+ include_ground_truth: bool,
56
+ num: Integer,
57
+ queries: ::Array[Float],
58
+ top_k: Integer,
59
+ request_options: Turbopuffer::RequestOptions
60
+ }
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,61 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_recall_response =
4
+ {
5
+ avg_ann_count: Float,
6
+ avg_exhaustive_count: Float,
7
+ avg_recall: Float,
8
+ ground_truth: ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]
9
+ }
10
+
11
+ class NamespaceRecallResponse < Turbopuffer::Internal::Type::BaseModel
12
+ attr_accessor avg_ann_count: Float
13
+
14
+ attr_accessor avg_exhaustive_count: Float
15
+
16
+ attr_accessor avg_recall: Float
17
+
18
+ attr_reader ground_truth: ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]?
19
+
20
+ def ground_truth=: (
21
+ ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]
22
+ ) -> ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]
23
+
24
+ def initialize: (
25
+ avg_ann_count: Float,
26
+ avg_exhaustive_count: Float,
27
+ avg_recall: Float,
28
+ ?ground_truth: ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]
29
+ ) -> void
30
+
31
+ def to_hash: -> {
32
+ avg_ann_count: Float,
33
+ avg_exhaustive_count: Float,
34
+ avg_recall: Float,
35
+ ground_truth: ::Array[Turbopuffer::Models::NamespaceRecallResponse::GroundTruth]
36
+ }
37
+
38
+ type ground_truth =
39
+ {
40
+ nearest_neighbors: ::Array[Turbopuffer::Row],
41
+ query_vector: ::Array[Float]
42
+ }
43
+
44
+ class GroundTruth < Turbopuffer::Internal::Type::BaseModel
45
+ attr_accessor nearest_neighbors: ::Array[Turbopuffer::Row]
46
+
47
+ attr_accessor query_vector: ::Array[Float]
48
+
49
+ def initialize: (
50
+ nearest_neighbors: ::Array[Turbopuffer::Row],
51
+ query_vector: ::Array[Float]
52
+ ) -> void
53
+
54
+ def to_hash: -> {
55
+ nearest_neighbors: ::Array[Turbopuffer::Row],
56
+ query_vector: ::Array[Float]
57
+ }
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,25 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_schema_params =
4
+ { namespace: String } & Turbopuffer::Internal::Type::request_parameters
5
+
6
+ class NamespaceSchemaParams < Turbopuffer::Internal::Type::BaseModel
7
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
8
+ include Turbopuffer::Internal::Type::RequestParameters
9
+
10
+ attr_reader namespace: String?
11
+
12
+ def namespace=: (String) -> String
13
+
14
+ def initialize: (
15
+ ?namespace: String,
16
+ ?request_options: Turbopuffer::request_opts
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ namespace: String,
21
+ request_options: Turbopuffer::RequestOptions
22
+ }
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,8 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_schema_response =
4
+ ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
5
+
6
+ NamespaceSchemaResponse: Turbopuffer::Internal::Type::Converter
7
+ end
8
+ end
@@ -0,0 +1,13 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_summary = { id: String }
4
+
5
+ class NamespaceSummary < Turbopuffer::Internal::Type::BaseModel
6
+ attr_accessor id: String
7
+
8
+ def initialize: (id: String) -> void
9
+
10
+ def to_hash: -> { id: String }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,37 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_update_schema_params =
4
+ {
5
+ namespace: String,
6
+ schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema]
7
+ }
8
+ & Turbopuffer::Internal::Type::request_parameters
9
+
10
+ class NamespaceUpdateSchemaParams < Turbopuffer::Internal::Type::BaseModel
11
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
12
+ include Turbopuffer::Internal::Type::RequestParameters
13
+
14
+ attr_reader namespace: String?
15
+
16
+ def namespace=: (String) -> String
17
+
18
+ attr_reader schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema]?
19
+
20
+ def schema=: (
21
+ ::Hash[Symbol, Turbopuffer::Models::attribute_schema]
22
+ ) -> ::Hash[Symbol, Turbopuffer::Models::attribute_schema]
23
+
24
+ def initialize: (
25
+ ?namespace: String,
26
+ ?schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
27
+ ?request_options: Turbopuffer::request_opts
28
+ ) -> void
29
+
30
+ def to_hash: -> {
31
+ namespace: String,
32
+ schema: ::Hash[Symbol, Turbopuffer::Models::attribute_schema],
33
+ request_options: Turbopuffer::RequestOptions
34
+ }
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,8 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_update_schema_response =
4
+ ::Hash[Symbol, Turbopuffer::AttributeSchemaConfig]
5
+
6
+ NamespaceUpdateSchemaResponse: Turbopuffer::Internal::Type::Converter
7
+ end
8
+ end
@@ -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