turbopuffer 0.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +218 -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/bm25_clause_params.rb +18 -0
  30. data/lib/turbopuffer/models/client_namespaces_params.rb +38 -0
  31. data/lib/turbopuffer/models/columns.rb +64 -0
  32. data/lib/turbopuffer/models/contains_all_tokens_filter_params.rb +18 -0
  33. data/lib/turbopuffer/models/distance_metric.rb +19 -0
  34. data/lib/turbopuffer/models/full_text_search.rb +20 -0
  35. data/lib/turbopuffer/models/full_text_search_config.rb +83 -0
  36. data/lib/turbopuffer/models/id.rb +19 -0
  37. data/lib/turbopuffer/models/include_attributes.rb +22 -0
  38. data/lib/turbopuffer/models/language.rb +32 -0
  39. data/lib/turbopuffer/models/namespace_delete_all_params.rb +20 -0
  40. data/lib/turbopuffer/models/namespace_delete_all_response.rb +19 -0
  41. data/lib/turbopuffer/models/namespace_explain_query_params.rb +137 -0
  42. data/lib/turbopuffer/models/namespace_explain_query_response.rb +19 -0
  43. data/lib/turbopuffer/models/namespace_hint_cache_warm_params.rb +20 -0
  44. data/lib/turbopuffer/models/namespace_hint_cache_warm_response.rb +26 -0
  45. data/lib/turbopuffer/models/namespace_metadata.rb +43 -0
  46. data/lib/turbopuffer/models/namespace_metadata_params.rb +20 -0
  47. data/lib/turbopuffer/models/namespace_multi_query_params.rb +73 -0
  48. data/lib/turbopuffer/models/namespace_multi_query_response.rb +58 -0
  49. data/lib/turbopuffer/models/namespace_query_params.rb +137 -0
  50. data/lib/turbopuffer/models/namespace_query_response.rb +49 -0
  51. data/lib/turbopuffer/models/namespace_recall_params.rb +66 -0
  52. data/lib/turbopuffer/models/namespace_recall_response.rb +68 -0
  53. data/lib/turbopuffer/models/namespace_schema_params.rb +20 -0
  54. data/lib/turbopuffer/models/namespace_schema_response.rb +8 -0
  55. data/lib/turbopuffer/models/namespace_summary.rb +19 -0
  56. data/lib/turbopuffer/models/namespace_update_schema_params.rb +29 -0
  57. data/lib/turbopuffer/models/namespace_update_schema_response.rb +9 -0
  58. data/lib/turbopuffer/models/namespace_write_params.rb +158 -0
  59. data/lib/turbopuffer/models/namespace_write_response.rb +67 -0
  60. data/lib/turbopuffer/models/query.rb +81 -0
  61. data/lib/turbopuffer/models/query_billing.rb +26 -0
  62. data/lib/turbopuffer/models/query_performance.rb +63 -0
  63. data/lib/turbopuffer/models/row.rb +46 -0
  64. data/lib/turbopuffer/models/tokenizer.rb +19 -0
  65. data/lib/turbopuffer/models/vector.rb +22 -0
  66. data/lib/turbopuffer/models/vector_encoding.rb +16 -0
  67. data/lib/turbopuffer/models/write_billing.rb +26 -0
  68. data/lib/turbopuffer/models.rb +110 -0
  69. data/lib/turbopuffer/namespace.rb +14 -50
  70. data/lib/turbopuffer/request_options.rb +77 -0
  71. data/lib/turbopuffer/resources/namespaces.rb +366 -0
  72. data/lib/turbopuffer/version.rb +1 -1
  73. data/lib/turbopuffer.rb +94 -4
  74. data/manifest.yaml +15 -0
  75. data/rbi/turbopuffer/client.rbi +91 -0
  76. data/rbi/turbopuffer/errors.rbi +205 -0
  77. data/rbi/turbopuffer/file_part.rbi +37 -0
  78. data/rbi/turbopuffer/internal/namespace_page.rbi +22 -0
  79. data/rbi/turbopuffer/internal/transport/base_client.rbi +297 -0
  80. data/rbi/turbopuffer/internal/transport/pooled_net_requester.rbi +80 -0
  81. data/rbi/turbopuffer/internal/type/array_of.rbi +104 -0
  82. data/rbi/turbopuffer/internal/type/base_model.rbi +304 -0
  83. data/rbi/turbopuffer/internal/type/base_page.rbi +43 -0
  84. data/rbi/turbopuffer/internal/type/boolean.rbi +58 -0
  85. data/rbi/turbopuffer/internal/type/converter.rbi +216 -0
  86. data/rbi/turbopuffer/internal/type/enum.rbi +82 -0
  87. data/rbi/turbopuffer/internal/type/file_input.rbi +59 -0
  88. data/rbi/turbopuffer/internal/type/hash_of.rbi +104 -0
  89. data/rbi/turbopuffer/internal/type/request_parameters.rbi +31 -0
  90. data/rbi/turbopuffer/internal/type/union.rbi +128 -0
  91. data/rbi/turbopuffer/internal/type/unknown.rbi +58 -0
  92. data/rbi/turbopuffer/internal/util.rbi +487 -0
  93. data/rbi/turbopuffer/internal.rbi +18 -0
  94. data/rbi/turbopuffer/models/aggregation_group.rbi +13 -0
  95. data/rbi/turbopuffer/models/attribute_schema.rbi +17 -0
  96. data/rbi/turbopuffer/models/attribute_schema_config.rbi +103 -0
  97. data/rbi/turbopuffer/models/attribute_type.rbi +7 -0
  98. data/rbi/turbopuffer/models/bm25_clause_params.rbi +31 -0
  99. data/rbi/turbopuffer/models/client_namespaces_params.rbi +71 -0
  100. data/rbi/turbopuffer/models/columns.rbi +82 -0
  101. data/rbi/turbopuffer/models/contains_all_tokens_filter_params.rbi +34 -0
  102. data/rbi/turbopuffer/models/distance_metric.rbi +27 -0
  103. data/rbi/turbopuffer/models/full_text_search.rbi +19 -0
  104. data/rbi/turbopuffer/models/full_text_search_config.rbi +133 -0
  105. data/rbi/turbopuffer/models/id.rbi +16 -0
  106. data/rbi/turbopuffer/models/include_attributes.rbi +24 -0
  107. data/rbi/turbopuffer/models/language.rbi +36 -0
  108. data/rbi/turbopuffer/models/namespace_delete_all_params.rbi +41 -0
  109. data/rbi/turbopuffer/models/namespace_delete_all_response.rbi +31 -0
  110. data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +273 -0
  111. data/rbi/turbopuffer/models/namespace_explain_query_response.rbi +34 -0
  112. data/rbi/turbopuffer/models/namespace_hint_cache_warm_params.rbi +41 -0
  113. data/rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi +38 -0
  114. data/rbi/turbopuffer/models/namespace_metadata.rbi +62 -0
  115. data/rbi/turbopuffer/models/namespace_metadata_params.rbi +41 -0
  116. data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +175 -0
  117. data/rbi/turbopuffer/models/namespace_multi_query_response.rbi +121 -0
  118. data/rbi/turbopuffer/models/namespace_query_params.rbi +267 -0
  119. data/rbi/turbopuffer/models/namespace_query_response.rbi +84 -0
  120. data/rbi/turbopuffer/models/namespace_recall_params.rbi +106 -0
  121. data/rbi/turbopuffer/models/namespace_recall_response.rbi +134 -0
  122. data/rbi/turbopuffer/models/namespace_schema_params.rbi +41 -0
  123. data/rbi/turbopuffer/models/namespace_schema_response.rbi +11 -0
  124. data/rbi/turbopuffer/models/namespace_summary.rbi +28 -0
  125. data/rbi/turbopuffer/models/namespace_update_schema_params.rbi +80 -0
  126. data/rbi/turbopuffer/models/namespace_update_schema_response.rbi +11 -0
  127. data/rbi/turbopuffer/models/namespace_write_params.rbi +290 -0
  128. data/rbi/turbopuffer/models/namespace_write_response.rbi +101 -0
  129. data/rbi/turbopuffer/models/query.rbi +132 -0
  130. data/rbi/turbopuffer/models/query_billing.rbi +46 -0
  131. data/rbi/turbopuffer/models/query_performance.rbi +82 -0
  132. data/rbi/turbopuffer/models/row.rbi +47 -0
  133. data/rbi/turbopuffer/models/tokenizer.rbi +24 -0
  134. data/rbi/turbopuffer/models/vector.rbi +22 -0
  135. data/rbi/turbopuffer/models/vector_encoding.rbi +22 -0
  136. data/rbi/turbopuffer/models/write_billing.rbi +49 -0
  137. data/rbi/turbopuffer/models.rbi +77 -0
  138. data/rbi/turbopuffer/namespace.rbi +8 -0
  139. data/rbi/turbopuffer/request_options.rbi +59 -0
  140. data/rbi/turbopuffer/resources/namespaces.rbi +304 -0
  141. data/rbi/turbopuffer/version.rbi +5 -0
  142. data/sig/turbopuffer/client.rbs +41 -0
  143. data/sig/turbopuffer/errors.rbs +117 -0
  144. data/sig/turbopuffer/file_part.rbs +21 -0
  145. data/sig/turbopuffer/internal/namespace_page.rbs +13 -0
  146. data/sig/turbopuffer/internal/transport/base_client.rbs +131 -0
  147. data/sig/turbopuffer/internal/transport/pooled_net_requester.rbs +45 -0
  148. data/sig/turbopuffer/internal/type/array_of.rbs +48 -0
  149. data/sig/turbopuffer/internal/type/base_model.rbs +102 -0
  150. data/sig/turbopuffer/internal/type/base_page.rbs +24 -0
  151. data/sig/turbopuffer/internal/type/boolean.rbs +26 -0
  152. data/sig/turbopuffer/internal/type/converter.rbs +79 -0
  153. data/sig/turbopuffer/internal/type/enum.rbs +32 -0
  154. data/sig/turbopuffer/internal/type/file_input.rbs +25 -0
  155. data/sig/turbopuffer/internal/type/hash_of.rbs +48 -0
  156. data/sig/turbopuffer/internal/type/request_parameters.rbs +19 -0
  157. data/sig/turbopuffer/internal/type/union.rbs +52 -0
  158. data/sig/turbopuffer/internal/type/unknown.rbs +26 -0
  159. data/sig/turbopuffer/internal/util.rbs +185 -0
  160. data/sig/turbopuffer/internal.rbs +9 -0
  161. data/sig/turbopuffer/models/aggregation_group.rbs +7 -0
  162. data/sig/turbopuffer/models/attribute_schema.rbs +11 -0
  163. data/sig/turbopuffer/models/attribute_schema_config.rbs +52 -0
  164. data/sig/turbopuffer/models/attribute_type.rbs +5 -0
  165. data/sig/turbopuffer/models/bm25_clause_params.rbs +15 -0
  166. data/sig/turbopuffer/models/client_namespaces_params.rbs +38 -0
  167. data/sig/turbopuffer/models/columns.rbs +42 -0
  168. data/sig/turbopuffer/models/contains_all_tokens_filter_params.rbs +15 -0
  169. data/sig/turbopuffer/models/distance_metric.rbs +17 -0
  170. data/sig/turbopuffer/models/full_text_search.rbs +11 -0
  171. data/sig/turbopuffer/models/full_text_search_config.rbs +75 -0
  172. data/sig/turbopuffer/models/id.rbs +11 -0
  173. data/sig/turbopuffer/models/include_attributes.rbs +13 -0
  174. data/sig/turbopuffer/models/language.rbs +48 -0
  175. data/sig/turbopuffer/models/namespace_delete_all_params.rbs +25 -0
  176. data/sig/turbopuffer/models/namespace_delete_all_response.rbs +13 -0
  177. data/sig/turbopuffer/models/namespace_explain_query_params.rbs +141 -0
  178. data/sig/turbopuffer/models/namespace_explain_query_response.rbs +15 -0
  179. data/sig/turbopuffer/models/namespace_hint_cache_warm_params.rbs +25 -0
  180. data/sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs +18 -0
  181. data/sig/turbopuffer/models/namespace_metadata.rbs +35 -0
  182. data/sig/turbopuffer/models/namespace_metadata_params.rbs +25 -0
  183. data/sig/turbopuffer/models/namespace_multi_query_params.rbs +86 -0
  184. data/sig/turbopuffer/models/namespace_multi_query_response.rbs +65 -0
  185. data/sig/turbopuffer/models/namespace_query_params.rbs +139 -0
  186. data/sig/turbopuffer/models/namespace_query_response.rbs +48 -0
  187. data/sig/turbopuffer/models/namespace_recall_params.rbs +63 -0
  188. data/sig/turbopuffer/models/namespace_recall_response.rbs +61 -0
  189. data/sig/turbopuffer/models/namespace_schema_params.rbs +25 -0
  190. data/sig/turbopuffer/models/namespace_schema_response.rbs +8 -0
  191. data/sig/turbopuffer/models/namespace_summary.rbs +13 -0
  192. data/sig/turbopuffer/models/namespace_update_schema_params.rbs +37 -0
  193. data/sig/turbopuffer/models/namespace_update_schema_response.rbs +8 -0
  194. data/sig/turbopuffer/models/namespace_write_params.rbs +156 -0
  195. data/sig/turbopuffer/models/namespace_write_response.rbs +56 -0
  196. data/sig/turbopuffer/models/query.rbs +75 -0
  197. data/sig/turbopuffer/models/query_billing.rbs +25 -0
  198. data/sig/turbopuffer/models/query_performance.rbs +45 -0
  199. data/sig/turbopuffer/models/row.rbs +24 -0
  200. data/sig/turbopuffer/models/tokenizer.rbs +16 -0
  201. data/sig/turbopuffer/models/vector.rbs +13 -0
  202. data/sig/turbopuffer/models/vector_encoding.rbs +14 -0
  203. data/sig/turbopuffer/models/write_billing.rbs +27 -0
  204. data/sig/turbopuffer/models.rbs +69 -0
  205. data/sig/turbopuffer/namespace.rbs +5 -0
  206. data/sig/turbopuffer/request_options.rbs +36 -0
  207. data/sig/turbopuffer/resources/namespaces.rbs +99 -0
  208. data/sig/turbopuffer/version.rbs +3 -0
  209. metadata +224 -29
  210. data/.standard.yml +0 -3
  211. data/LICENSE.txt +0 -21
  212. data/Rakefile +0 -10
  213. data/sig/turbopuffer.rbs +0 -4
@@ -0,0 +1,86 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_multi_query_params =
4
+ {
5
+ namespace: String,
6
+ queries: ::Array[Turbopuffer::Query],
7
+ consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency,
8
+ vector_encoding: Turbopuffer::Models::vector_encoding
9
+ }
10
+ & Turbopuffer::Internal::Type::request_parameters
11
+
12
+ class NamespaceMultiQueryParams < Turbopuffer::Internal::Type::BaseModel
13
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
14
+ include Turbopuffer::Internal::Type::RequestParameters
15
+
16
+ attr_reader namespace: String?
17
+
18
+ def namespace=: (String) -> String
19
+
20
+ attr_accessor queries: ::Array[Turbopuffer::Query]
21
+
22
+ attr_reader consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency?
23
+
24
+ def consistency=: (
25
+ Turbopuffer::NamespaceMultiQueryParams::Consistency
26
+ ) -> Turbopuffer::NamespaceMultiQueryParams::Consistency
27
+
28
+ attr_reader vector_encoding: Turbopuffer::Models::vector_encoding?
29
+
30
+ def vector_encoding=: (
31
+ Turbopuffer::Models::vector_encoding
32
+ ) -> Turbopuffer::Models::vector_encoding
33
+
34
+ def initialize: (
35
+ queries: ::Array[Turbopuffer::Query],
36
+ ?namespace: String,
37
+ ?consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency,
38
+ ?vector_encoding: Turbopuffer::Models::vector_encoding,
39
+ ?request_options: Turbopuffer::request_opts
40
+ ) -> void
41
+
42
+ def to_hash: -> {
43
+ namespace: String,
44
+ queries: ::Array[Turbopuffer::Query],
45
+ consistency: Turbopuffer::NamespaceMultiQueryParams::Consistency,
46
+ vector_encoding: Turbopuffer::Models::vector_encoding,
47
+ request_options: Turbopuffer::RequestOptions
48
+ }
49
+
50
+ type consistency =
51
+ {
52
+ level: Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level
53
+ }
54
+
55
+ class Consistency < Turbopuffer::Internal::Type::BaseModel
56
+ attr_reader level: Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level?
57
+
58
+ def level=: (
59
+ Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level
60
+ ) -> Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level
61
+
62
+ def initialize: (
63
+ ?level: Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ level: Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level
68
+ }
69
+
70
+ type level = :strong | :eventual
71
+
72
+ module Level
73
+ extend Turbopuffer::Internal::Type::Enum
74
+
75
+ # Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
76
+ STRONG: :strong
77
+
78
+ # Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
79
+ EVENTUAL: :eventual
80
+
81
+ def self?.values: -> ::Array[Turbopuffer::Models::NamespaceMultiQueryParams::Consistency::level]
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,65 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_multi_query_response =
4
+ {
5
+ billing: Turbopuffer::QueryBilling,
6
+ performance: Turbopuffer::QueryPerformance,
7
+ results: ::Array[Turbopuffer::Models::NamespaceMultiQueryResponse::Result]
8
+ }
9
+
10
+ class NamespaceMultiQueryResponse < Turbopuffer::Internal::Type::BaseModel
11
+ attr_accessor billing: Turbopuffer::QueryBilling
12
+
13
+ attr_accessor performance: Turbopuffer::QueryPerformance
14
+
15
+ attr_accessor results: ::Array[Turbopuffer::Models::NamespaceMultiQueryResponse::Result]
16
+
17
+ def initialize: (
18
+ billing: Turbopuffer::QueryBilling,
19
+ performance: Turbopuffer::QueryPerformance,
20
+ results: ::Array[Turbopuffer::Models::NamespaceMultiQueryResponse::Result]
21
+ ) -> void
22
+
23
+ def to_hash: -> {
24
+ billing: Turbopuffer::QueryBilling,
25
+ performance: Turbopuffer::QueryPerformance,
26
+ results: ::Array[Turbopuffer::Models::NamespaceMultiQueryResponse::Result]
27
+ }
28
+
29
+ type result =
30
+ {
31
+ aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
32
+ aggregations: ::Hash[Symbol, top],
33
+ rows: ::Array[Turbopuffer::Row]
34
+ }
35
+
36
+ class Result < Turbopuffer::Internal::Type::BaseModel
37
+ attr_reader aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group]?
38
+
39
+ def aggregation_groups=: (
40
+ ::Array[Turbopuffer::Models::aggregation_group]
41
+ ) -> ::Array[Turbopuffer::Models::aggregation_group]
42
+
43
+ attr_reader aggregations: ::Hash[Symbol, top]?
44
+
45
+ def aggregations=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
46
+
47
+ attr_reader rows: ::Array[Turbopuffer::Row]?
48
+
49
+ def rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
50
+
51
+ def initialize: (
52
+ ?aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
53
+ ?aggregations: ::Hash[Symbol, top],
54
+ ?rows: ::Array[Turbopuffer::Row]
55
+ ) -> void
56
+
57
+ def to_hash: -> {
58
+ aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
59
+ aggregations: ::Hash[Symbol, top],
60
+ rows: ::Array[Turbopuffer::Row]
61
+ }
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,139 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_query_params =
4
+ {
5
+ namespace: String,
6
+ aggregate_by: ::Hash[Symbol, top],
7
+ consistency: Turbopuffer::NamespaceQueryParams::Consistency,
8
+ distance_metric: Turbopuffer::Models::distance_metric,
9
+ exclude_attributes: ::Array[String],
10
+ filters: top,
11
+ group_by: ::Array[String],
12
+ include_attributes: Turbopuffer::Models::include_attributes,
13
+ rank_by: top,
14
+ top_k: Integer,
15
+ vector_encoding: Turbopuffer::Models::vector_encoding
16
+ }
17
+ & Turbopuffer::Internal::Type::request_parameters
18
+
19
+ class NamespaceQueryParams < Turbopuffer::Internal::Type::BaseModel
20
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
21
+ include Turbopuffer::Internal::Type::RequestParameters
22
+
23
+ attr_reader namespace: String?
24
+
25
+ def namespace=: (String) -> String
26
+
27
+ attr_reader aggregate_by: ::Hash[Symbol, top]?
28
+
29
+ def aggregate_by=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
30
+
31
+ attr_reader consistency: Turbopuffer::NamespaceQueryParams::Consistency?
32
+
33
+ def consistency=: (
34
+ Turbopuffer::NamespaceQueryParams::Consistency
35
+ ) -> Turbopuffer::NamespaceQueryParams::Consistency
36
+
37
+ attr_reader distance_metric: Turbopuffer::Models::distance_metric?
38
+
39
+ def distance_metric=: (
40
+ Turbopuffer::Models::distance_metric
41
+ ) -> Turbopuffer::Models::distance_metric
42
+
43
+ attr_reader exclude_attributes: ::Array[String]?
44
+
45
+ def exclude_attributes=: (::Array[String]) -> ::Array[String]
46
+
47
+ attr_reader filters: top?
48
+
49
+ def filters=: (top) -> top
50
+
51
+ attr_reader group_by: ::Array[String]?
52
+
53
+ def group_by=: (::Array[String]) -> ::Array[String]
54
+
55
+ attr_reader include_attributes: Turbopuffer::Models::include_attributes?
56
+
57
+ def include_attributes=: (
58
+ Turbopuffer::Models::include_attributes
59
+ ) -> Turbopuffer::Models::include_attributes
60
+
61
+ attr_reader rank_by: top?
62
+
63
+ def rank_by=: (top) -> top
64
+
65
+ attr_reader top_k: Integer?
66
+
67
+ def top_k=: (Integer) -> Integer
68
+
69
+ attr_reader vector_encoding: Turbopuffer::Models::vector_encoding?
70
+
71
+ def vector_encoding=: (
72
+ Turbopuffer::Models::vector_encoding
73
+ ) -> Turbopuffer::Models::vector_encoding
74
+
75
+ def initialize: (
76
+ ?namespace: String,
77
+ ?aggregate_by: ::Hash[Symbol, top],
78
+ ?consistency: Turbopuffer::NamespaceQueryParams::Consistency,
79
+ ?distance_metric: Turbopuffer::Models::distance_metric,
80
+ ?exclude_attributes: ::Array[String],
81
+ ?filters: top,
82
+ ?group_by: ::Array[String],
83
+ ?include_attributes: Turbopuffer::Models::include_attributes,
84
+ ?rank_by: top,
85
+ ?top_k: Integer,
86
+ ?vector_encoding: Turbopuffer::Models::vector_encoding,
87
+ ?request_options: Turbopuffer::request_opts
88
+ ) -> void
89
+
90
+ def to_hash: -> {
91
+ namespace: String,
92
+ aggregate_by: ::Hash[Symbol, top],
93
+ consistency: Turbopuffer::NamespaceQueryParams::Consistency,
94
+ distance_metric: Turbopuffer::Models::distance_metric,
95
+ exclude_attributes: ::Array[String],
96
+ filters: top,
97
+ group_by: ::Array[String],
98
+ include_attributes: Turbopuffer::Models::include_attributes,
99
+ rank_by: top,
100
+ top_k: Integer,
101
+ vector_encoding: Turbopuffer::Models::vector_encoding,
102
+ request_options: Turbopuffer::RequestOptions
103
+ }
104
+
105
+ type consistency =
106
+ { level: Turbopuffer::Models::NamespaceQueryParams::Consistency::level }
107
+
108
+ class Consistency < Turbopuffer::Internal::Type::BaseModel
109
+ attr_reader level: Turbopuffer::Models::NamespaceQueryParams::Consistency::level?
110
+
111
+ def level=: (
112
+ Turbopuffer::Models::NamespaceQueryParams::Consistency::level
113
+ ) -> Turbopuffer::Models::NamespaceQueryParams::Consistency::level
114
+
115
+ def initialize: (
116
+ ?level: Turbopuffer::Models::NamespaceQueryParams::Consistency::level
117
+ ) -> void
118
+
119
+ def to_hash: -> {
120
+ level: Turbopuffer::Models::NamespaceQueryParams::Consistency::level
121
+ }
122
+
123
+ type level = :strong | :eventual
124
+
125
+ module Level
126
+ extend Turbopuffer::Internal::Type::Enum
127
+
128
+ # Strong consistency. Requires a round-trip to object storage to fetch the latest writes.
129
+ STRONG: :strong
130
+
131
+ # Eventual consistency. Does not require a round-trip to object storage, but may not see the latest writes.
132
+ EVENTUAL: :eventual
133
+
134
+ def self?.values: -> ::Array[Turbopuffer::Models::NamespaceQueryParams::Consistency::level]
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,48 @@
1
+ module Turbopuffer
2
+ module Models
3
+ type namespace_query_response =
4
+ {
5
+ billing: Turbopuffer::QueryBilling,
6
+ performance: Turbopuffer::QueryPerformance,
7
+ aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
8
+ aggregations: ::Hash[Symbol, top],
9
+ rows: ::Array[Turbopuffer::Row]
10
+ }
11
+
12
+ class NamespaceQueryResponse < Turbopuffer::Internal::Type::BaseModel
13
+ attr_accessor billing: Turbopuffer::QueryBilling
14
+
15
+ attr_accessor performance: Turbopuffer::QueryPerformance
16
+
17
+ attr_reader aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group]?
18
+
19
+ def aggregation_groups=: (
20
+ ::Array[Turbopuffer::Models::aggregation_group]
21
+ ) -> ::Array[Turbopuffer::Models::aggregation_group]
22
+
23
+ attr_reader aggregations: ::Hash[Symbol, top]?
24
+
25
+ def aggregations=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
26
+
27
+ attr_reader rows: ::Array[Turbopuffer::Row]?
28
+
29
+ def rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
30
+
31
+ def initialize: (
32
+ billing: Turbopuffer::QueryBilling,
33
+ performance: Turbopuffer::QueryPerformance,
34
+ ?aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
35
+ ?aggregations: ::Hash[Symbol, top],
36
+ ?rows: ::Array[Turbopuffer::Row]
37
+ ) -> void
38
+
39
+ def to_hash: -> {
40
+ billing: Turbopuffer::QueryBilling,
41
+ performance: Turbopuffer::QueryPerformance,
42
+ aggregation_groups: ::Array[Turbopuffer::Models::aggregation_group],
43
+ aggregations: ::Hash[Symbol, top],
44
+ rows: ::Array[Turbopuffer::Row]
45
+ }
46
+ end
47
+ end
48
+ end
@@ -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