turbopuffer-ruby 0.2.4 → 0.2.6

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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/turbopuffer/internal/type/array_of.rb +1 -0
  5. data/lib/turbopuffer/internal/type/base_model.rb +3 -1
  6. data/lib/turbopuffer/internal/type/converter.rb +27 -0
  7. data/lib/turbopuffer/internal/type/hash_of.rb +1 -0
  8. data/lib/turbopuffer/internal/type/union.rb +9 -7
  9. data/lib/turbopuffer/models/namespace_explain_query_params.rb +10 -1
  10. data/lib/turbopuffer/models/namespace_hint_cache_warm_response.rb +4 -4
  11. data/lib/turbopuffer/models/namespace_multi_query_response.rb +7 -1
  12. data/lib/turbopuffer/models/namespace_query_params.rb +10 -1
  13. data/lib/turbopuffer/models/namespace_query_response.rb +8 -1
  14. data/lib/turbopuffer/models/query.rb +10 -1
  15. data/lib/turbopuffer/resources/namespaces.rb +6 -2
  16. data/lib/turbopuffer/version.rb +1 -1
  17. data/rbi/turbopuffer/internal/type/converter.rbi +54 -0
  18. data/rbi/turbopuffer/internal/type/union.rbi +9 -2
  19. data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +13 -0
  20. data/rbi/turbopuffer/models/namespace_hint_cache_warm_response.rbi +1 -1
  21. data/rbi/turbopuffer/models/namespace_multi_query_response.rbi +11 -1
  22. data/rbi/turbopuffer/models/namespace_query_params.rbi +13 -0
  23. data/rbi/turbopuffer/models/namespace_query_response.rbi +11 -0
  24. data/rbi/turbopuffer/models/query.rbi +13 -0
  25. data/rbi/turbopuffer/resources/namespaces.rbi +8 -0
  26. data/sig/turbopuffer/internal/type/converter.rbs +17 -0
  27. data/sig/turbopuffer/internal/type/union.rbs +2 -2
  28. data/sig/turbopuffer/models/namespace_explain_query_params.rbs +7 -0
  29. data/sig/turbopuffer/models/namespace_hint_cache_warm_response.rbs +5 -4
  30. data/sig/turbopuffer/models/namespace_multi_query_response.rbs +13 -1
  31. data/sig/turbopuffer/models/namespace_query_params.rbs +7 -0
  32. data/sig/turbopuffer/models/namespace_query_response.rbs +9 -0
  33. data/sig/turbopuffer/models/query.rbs +7 -0
  34. data/sig/turbopuffer/resources/namespaces.rbs +2 -0
  35. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cdba184c47706f13e46349844edd154024ecb50b0cd898b1e472bee7122595f
4
- data.tar.gz: d2a2652222e2e672c9069bc965ece1bac43351804670331410aa91462eaa1f7c
3
+ metadata.gz: e68ecf643e3ef570edf2c61bfb412c27d9c2c17fbaf5e4c614c7d5aa2afa3e05
4
+ data.tar.gz: '095f4ccefed27b4a1479ecdb5c10a88a7a2017f1aa4f25188c321b206765aba4'
5
5
  SHA512:
6
- metadata.gz: 0c42de89acf1dc7246fb9ef1ad915bb0e5d0c1bdb74b1d842851d3eeb576ed8ed3cc2047d6d255053b7a21bd7561dbf6a757620ff2ec9099ada4c9a98ddfc487
7
- data.tar.gz: 25b6fdfc5c41998e5bb415ecebd39f6b8c6583047bf44a27714363044ffa7c70d86d53ae7e17379514885e8c4ac2191c1e7e292ea0d9aecb8e6b273ded29452d
6
+ metadata.gz: febffe23d0069251a67e807e34cb502bf9a40bd819e755c72a7c6c369898143145767c6fb8362c2e66138247abc9886dd04154c37be11aeaf20cb05230249314
7
+ data.tar.gz: d6be41a93adaf04d4c3eacb77ff1e9efff4fe2d38ad616f5d70da99b5e8834f31c9babded64d1a1f84645d6a4fc9146bbb625647890ad1adbe1683ecaf24b41b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.6 (2025-08-18)
4
+
5
+ Full Changelog: [v0.2.5...v0.2.6](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.5...v0.2.6)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **api:** add support for `group_by` query parameter ([c4e6261](https://github.com/turbopuffer/turbopuffer-ruby/commit/c4e626148df5642d654e5ae739d07588fcd4ad5d))
10
+ * remove 200 error code for hint_cache_warm API call (always 202 now) ([bbd6d75](https://github.com/turbopuffer/turbopuffer-ruby/commit/bbd6d759e25a1b7b4dd8e3208acc1089f1d35f36))
11
+
12
+
13
+ ### Chores
14
+
15
+ * **internal:** codegen related update ([880022b](https://github.com/turbopuffer/turbopuffer-ruby/commit/880022bea36595da811d14bd5a2e610624b283eb))
16
+
17
+ ## 0.2.5 (2025-08-11)
18
+
19
+ Full Changelog: [v0.2.4...v0.2.5](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.4...v0.2.5)
20
+
21
+ ### Chores
22
+
23
+ * collect metadata from type DSL ([79bb9bd](https://github.com/turbopuffer/turbopuffer-ruby/commit/79bb9bd39297006af6693580f09d35c1c801500f))
24
+ * **internal:** update comment in script ([0b151c0](https://github.com/turbopuffer/turbopuffer-ruby/commit/0b151c035ce5ba8785c3499247843428ba8267bd))
25
+ * update @stainless-api/prism-cli to v5.15.0 ([bb9a4b1](https://github.com/turbopuffer/turbopuffer-ruby/commit/bb9a4b1de0ac931671b2abeefa9c4cf8a67bae63))
26
+
3
27
  ## 0.2.4 (2025-08-01)
4
28
 
5
29
  Full Changelog: [v0.2.3...v0.2.4](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.3...v0.2.4)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "turbopuffer-ruby", "~> 0.2.4"
20
+ gem "turbopuffer-ruby", "~> 0.2.6"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -148,6 +148,7 @@ module Turbopuffer
148
148
  # @option spec [Boolean] :"nil?"
149
149
  def initialize(type_info, spec = {})
150
150
  @item_type_fn = Turbopuffer::Internal::Type::Converter.type_info(type_info || spec)
151
+ @meta = Turbopuffer::Internal::Type::Converter.meta_info(type_info, spec)
151
152
  @nilable = spec.fetch(:nil?, false)
152
153
  end
153
154
 
@@ -52,6 +52,7 @@ module Turbopuffer
52
52
  #
53
53
  # @option spec [Boolean] :"nil?"
54
54
  private def add_field(name_sym, required:, type_info:, spec:)
55
+ meta = Turbopuffer::Internal::Type::Converter.meta_info(type_info, spec)
55
56
  type_fn, info =
56
57
  case type_info
57
58
  in Proc | Turbopuffer::Internal::Type::Converter | Class
@@ -81,7 +82,8 @@ module Turbopuffer
81
82
  required: required,
82
83
  nilable: nilable,
83
84
  const: const,
84
- type_fn: type_fn
85
+ type_fn: type_fn,
86
+ meta: meta
85
87
  }
86
88
 
87
89
  define_method(setter) do |value|
@@ -98,6 +98,33 @@ module Turbopuffer
98
98
  end
99
99
  end
100
100
 
101
+ # @api private
102
+ #
103
+ # @param type_info [Hash{Symbol=>Object}, Proc, Turbopuffer::Internal::Type::Converter, Class] .
104
+ #
105
+ # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
106
+ #
107
+ # @option type_info [Proc] :enum
108
+ #
109
+ # @option type_info [Proc] :union
110
+ #
111
+ # @option type_info [Boolean] :"nil?"
112
+ #
113
+ # @param spec [Hash{Symbol=>Object}, Proc, Turbopuffer::Internal::Type::Converter, Class] .
114
+ #
115
+ # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const
116
+ #
117
+ # @option spec [Proc] :enum
118
+ #
119
+ # @option spec [Proc] :union
120
+ #
121
+ # @option spec [Boolean] :"nil?"
122
+ #
123
+ # @return [Hash{Symbol=>Object}]
124
+ def meta_info(type_info, spec)
125
+ [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?)
126
+ end
127
+
101
128
  # @api private
102
129
  #
103
130
  # @param translate_names [Boolean]
@@ -168,6 +168,7 @@ module Turbopuffer
168
168
  # @option spec [Boolean] :"nil?"
169
169
  def initialize(type_info, spec = {})
170
170
  @item_type_fn = Turbopuffer::Internal::Type::Converter.type_info(type_info || spec)
171
+ @meta = Turbopuffer::Internal::Type::Converter.meta_info(type_info, spec)
171
172
  @nilable = spec.fetch(:nil?, false)
172
173
  end
173
174
 
@@ -23,20 +23,20 @@ module Turbopuffer
23
23
  #
24
24
  # All of the specified variant info for this union.
25
25
  #
26
- # @return [Array<Array(Symbol, Proc)>]
26
+ # @return [Array<Array(Symbol, Proc, Hash{Symbol=>Object})>]
27
27
  private def known_variants = (@known_variants ||= [])
28
28
 
29
29
  # @api private
30
30
  #
31
- # @return [Array<Array(Symbol, Object)>]
31
+ # @return [Array<Array(Symbol, Object, Hash{Symbol=>Object})>]
32
32
  protected def derefed_variants
33
- known_variants.map { |key, variant_fn| [key, variant_fn.call] }
33
+ known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] }
34
34
  end
35
35
 
36
36
  # All of the specified variants for this union.
37
37
  #
38
38
  # @return [Array<Object>]
39
- def variants = derefed_variants.map(&:last)
39
+ def variants = derefed_variants.map { _2 }
40
40
 
41
41
  # @api private
42
42
  #
@@ -62,12 +62,13 @@ module Turbopuffer
62
62
  #
63
63
  # @option spec [Boolean] :"nil?"
64
64
  private def variant(key, spec = nil)
65
+ meta = Turbopuffer::Internal::Type::Converter.meta_info(nil, spec)
65
66
  variant_info =
66
67
  case key
67
68
  in Symbol
68
- [key, Turbopuffer::Internal::Type::Converter.type_info(spec)]
69
+ [key, Turbopuffer::Internal::Type::Converter.type_info(spec), meta]
69
70
  in Proc | Turbopuffer::Internal::Type::Converter | Class | Hash
70
- [nil, Turbopuffer::Internal::Type::Converter.type_info(key)]
71
+ [nil, Turbopuffer::Internal::Type::Converter.type_info(key), meta]
71
72
  end
72
73
 
73
74
  known_variants << variant_info
@@ -90,7 +91,8 @@ module Turbopuffer
90
91
  return nil if key == Turbopuffer::Internal::OMIT
91
92
 
92
93
  key = key.to_sym if key.is_a?(String)
93
- known_variants.find { |k,| k == key }&.last&.call
94
+ _, found = known_variants.find { |k,| k == key }
95
+ found&.call
94
96
  else
95
97
  nil
96
98
  end
@@ -45,6 +45,13 @@ module Turbopuffer
45
45
  # @return [Object, nil]
46
46
  optional :filters, Turbopuffer::Internal::Type::Unknown
47
47
 
48
+ # @!attribute group_by
49
+ # Groups documents by the specified attributes (the "group key") before computing
50
+ # aggregates. Aggregates are computed separately for each group.
51
+ #
52
+ # @return [Array<String>, nil]
53
+ optional :group_by, Turbopuffer::Internal::Type::ArrayOf[String]
54
+
48
55
  # @!attribute include_attributes
49
56
  # Whether to include attributes in the response.
50
57
  #
@@ -69,7 +76,7 @@ module Turbopuffer
69
76
  # @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
70
77
  optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
71
78
 
72
- # @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
79
+ # @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
73
80
  # Some parameter documentations has been truncated, see
74
81
  # {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
75
82
  #
@@ -85,6 +92,8 @@ module Turbopuffer
85
92
  #
86
93
  # @param filters [Object] Exact filters for attributes to refine search results for. Think of it as a SQL
87
94
  #
95
+ # @param group_by [Array<String>] Groups documents by the specified attributes (the "group key") before computing
96
+ #
88
97
  # @param include_attributes [Boolean, Array<String>] Whether to include attributes in the response.
89
98
  #
90
99
  # @param rank_by [Object] How to rank the documents in the namespace.
@@ -7,20 +7,20 @@ module Turbopuffer
7
7
  # @!attribute status
8
8
  # The status of the request.
9
9
  #
10
- # @return [Symbol, :OK]
11
- required :status, const: :OK
10
+ # @return [Symbol, :ACCEPTED]
11
+ required :status, const: :ACCEPTED
12
12
 
13
13
  # @!attribute message
14
14
  #
15
15
  # @return [String, nil]
16
16
  optional :message, String
17
17
 
18
- # @!method initialize(message: nil, status: :OK)
18
+ # @!method initialize(message: nil, status: :ACCEPTED)
19
19
  # The response to a successful cache warm request.
20
20
  #
21
21
  # @param message [String]
22
22
  #
23
- # @param status [Symbol, :OK] The status of the request.
23
+ # @param status [Symbol, :ACCEPTED] The status of the request.
24
24
  end
25
25
  end
26
26
  end
@@ -32,6 +32,11 @@ module Turbopuffer
32
32
  # @param results [Array<Turbopuffer::Models::NamespaceMultiQueryResponse::Result>]
33
33
 
34
34
  class Result < Turbopuffer::Internal::Type::BaseModel
35
+ # @!attribute aggregation_groups
36
+ #
37
+ # @return [Array<Turbopuffer::Models::Row>, nil]
38
+ optional :aggregation_groups, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
39
+
35
40
  # @!attribute aggregations
36
41
  #
37
42
  # @return [Hash{Symbol=>Object}, nil]
@@ -42,7 +47,8 @@ module Turbopuffer
42
47
  # @return [Array<Turbopuffer::Models::Row>, nil]
43
48
  optional :rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
44
49
 
45
- # @!method initialize(aggregations: nil, rows: nil)
50
+ # @!method initialize(aggregation_groups: nil, aggregations: nil, rows: nil)
51
+ # @param aggregation_groups [Array<Turbopuffer::Models::Row>]
46
52
  # @param aggregations [Hash{Symbol=>Object}]
47
53
  # @param rows [Array<Turbopuffer::Models::Row>]
48
54
  end
@@ -45,6 +45,13 @@ module Turbopuffer
45
45
  # @return [Object, nil]
46
46
  optional :filters, Turbopuffer::Internal::Type::Unknown
47
47
 
48
+ # @!attribute group_by
49
+ # Groups documents by the specified attributes (the "group key") before computing
50
+ # aggregates. Aggregates are computed separately for each group.
51
+ #
52
+ # @return [Array<String>, nil]
53
+ optional :group_by, Turbopuffer::Internal::Type::ArrayOf[String]
54
+
48
55
  # @!attribute include_attributes
49
56
  # Whether to include attributes in the response.
50
57
  #
@@ -69,7 +76,7 @@ module Turbopuffer
69
76
  # @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
70
77
  optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
71
78
 
72
- # @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
79
+ # @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
73
80
  # Some parameter documentations has been truncated, see
74
81
  # {Turbopuffer::Models::NamespaceQueryParams} for more details.
75
82
  #
@@ -85,6 +92,8 @@ module Turbopuffer
85
92
  #
86
93
  # @param filters [Object] Exact filters for attributes to refine search results for. Think of it as a SQL
87
94
  #
95
+ # @param group_by [Array<String>] Groups documents by the specified attributes (the "group key") before computing
96
+ #
88
97
  # @param include_attributes [Boolean, Array<String>] Whether to include attributes in the response.
89
98
  #
90
99
  # @param rank_by [Object] How to rank the documents in the namespace.
@@ -16,6 +16,11 @@ module Turbopuffer
16
16
  # @return [Turbopuffer::Models::QueryPerformance]
17
17
  required :performance, -> { Turbopuffer::QueryPerformance }
18
18
 
19
+ # @!attribute aggregation_groups
20
+ #
21
+ # @return [Array<Turbopuffer::Models::Row>, nil]
22
+ optional :aggregation_groups, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
23
+
19
24
  # @!attribute aggregations
20
25
  #
21
26
  # @return [Hash{Symbol=>Object}, nil]
@@ -26,13 +31,15 @@ module Turbopuffer
26
31
  # @return [Array<Turbopuffer::Models::Row>, nil]
27
32
  optional :rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
28
33
 
29
- # @!method initialize(billing:, performance:, aggregations: nil, rows: nil)
34
+ # @!method initialize(billing:, performance:, aggregation_groups: nil, aggregations: nil, rows: nil)
30
35
  # The result of a query.
31
36
  #
32
37
  # @param billing [Turbopuffer::Models::QueryBilling] The billing information for a query.
33
38
  #
34
39
  # @param performance [Turbopuffer::Models::QueryPerformance] The performance information for a query.
35
40
  #
41
+ # @param aggregation_groups [Array<Turbopuffer::Models::Row>]
42
+ #
36
43
  # @param aggregations [Hash{Symbol=>Object}]
37
44
  #
38
45
  # @param rows [Array<Turbopuffer::Models::Row>]
@@ -30,6 +30,13 @@ module Turbopuffer
30
30
  # @return [Object, nil]
31
31
  optional :filters, Turbopuffer::Internal::Type::Unknown
32
32
 
33
+ # @!attribute group_by
34
+ # Groups documents by the specified attributes (the "group key") before computing
35
+ # aggregates. Aggregates are computed separately for each group.
36
+ #
37
+ # @return [Array<String>, nil]
38
+ optional :group_by, Turbopuffer::Internal::Type::ArrayOf[String]
39
+
33
40
  # @!attribute include_attributes
34
41
  # Whether to include attributes in the response.
35
42
  #
@@ -48,7 +55,7 @@ module Turbopuffer
48
55
  # @return [Integer, nil]
49
56
  optional :top_k, Integer
50
57
 
51
- # @!method initialize(aggregate_by: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil)
58
+ # @!method initialize(aggregate_by: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil)
52
59
  # Some parameter documentations has been truncated, see
53
60
  # {Turbopuffer::Models::Query} for more details.
54
61
  #
@@ -62,6 +69,8 @@ module Turbopuffer
62
69
  #
63
70
  # @param filters [Object] Exact filters for attributes to refine search results for. Think of it as a SQL
64
71
  #
72
+ # @param group_by [Array<String>] Groups documents by the specified attributes (the "group key") before computing
73
+ #
65
74
  # @param include_attributes [Boolean, Array<String>] Whether to include attributes in the response.
66
75
  #
67
76
  # @param rank_by [Object] How to rank the documents in the namespace.
@@ -33,7 +33,7 @@ module Turbopuffer
33
33
  #
34
34
  # Explain a query plan.
35
35
  #
36
- # @overload explain_query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
36
+ # @overload explain_query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
37
37
  #
38
38
  # @param namespace [String] Path param: The name of the namespace.
39
39
  #
@@ -47,6 +47,8 @@ module Turbopuffer
47
47
  #
48
48
  # @param filters [Object] Body param: Exact filters for attributes to refine search results for. Think of
49
49
  #
50
+ # @param group_by [Array<String>] Body param: Groups documents by the specified attributes (the "group key") befor
51
+ #
50
52
  # @param include_attributes [Boolean, Array<String>] Body param: Whether to include attributes in the response.
51
53
  #
52
54
  # @param rank_by [Object] Body param: How to rank the documents in the namespace.
@@ -162,7 +164,7 @@ module Turbopuffer
162
164
  #
163
165
  # Query, filter, full-text search and vector search documents.
164
166
  #
165
- # @overload query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
167
+ # @overload query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
166
168
  #
167
169
  # @param namespace [String] Path param: The name of the namespace.
168
170
  #
@@ -176,6 +178,8 @@ module Turbopuffer
176
178
  #
177
179
  # @param filters [Object] Body param: Exact filters for attributes to refine search results for. Think of
178
180
  #
181
+ # @param group_by [Array<String>] Body param: Groups documents by the specified attributes (the "group key") befor
182
+ #
179
183
  # @param include_attributes [Boolean, Array<String>] Body param: Whether to include attributes in the response.
180
184
  #
181
185
  # @param rank_by [Object] Body param: How to rank the documents in the namespace.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Turbopuffer
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.6"
5
5
  end
@@ -90,6 +90,60 @@ module Turbopuffer
90
90
  def self.type_info(spec)
91
91
  end
92
92
 
93
+ # @api private
94
+ sig do
95
+ params(
96
+ type_info:
97
+ T.any(
98
+ {
99
+ const:
100
+ T.nilable(
101
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
102
+ ),
103
+ enum:
104
+ T.nilable(
105
+ T.proc.returns(
106
+ Turbopuffer::Internal::Type::Converter::Input
107
+ )
108
+ ),
109
+ union:
110
+ T.nilable(
111
+ T.proc.returns(
112
+ Turbopuffer::Internal::Type::Converter::Input
113
+ )
114
+ )
115
+ },
116
+ T.proc.returns(Turbopuffer::Internal::Type::Converter::Input),
117
+ Turbopuffer::Internal::Type::Converter::Input
118
+ ),
119
+ spec:
120
+ T.any(
121
+ {
122
+ const:
123
+ T.nilable(
124
+ T.any(NilClass, T::Boolean, Integer, Float, Symbol)
125
+ ),
126
+ enum:
127
+ T.nilable(
128
+ T.proc.returns(
129
+ Turbopuffer::Internal::Type::Converter::Input
130
+ )
131
+ ),
132
+ union:
133
+ T.nilable(
134
+ T.proc.returns(
135
+ Turbopuffer::Internal::Type::Converter::Input
136
+ )
137
+ )
138
+ },
139
+ T.proc.returns(Turbopuffer::Internal::Type::Converter::Input),
140
+ Turbopuffer::Internal::Type::Converter::Input
141
+ )
142
+ ).returns(Turbopuffer::Internal::AnyHash)
143
+ end
144
+ def self.meta_info(type_info, spec)
145
+ end
146
+
93
147
  # @api private
94
148
  sig do
95
149
  params(translate_names: T::Boolean).returns(
@@ -16,7 +16,8 @@ module Turbopuffer
16
16
  T::Array[
17
17
  [
18
18
  T.nilable(Symbol),
19
- T.proc.returns(Turbopuffer::Internal::Type::Converter::Input)
19
+ T.proc.returns(Turbopuffer::Internal::Type::Converter::Input),
20
+ Turbopuffer::Internal::AnyHash
20
21
  ]
21
22
  ]
22
23
  )
@@ -25,7 +26,13 @@ module Turbopuffer
25
26
  end
26
27
 
27
28
  # @api private
28
- sig { returns(T::Array[[T.nilable(Symbol), T.anything]]) }
29
+ sig do
30
+ returns(
31
+ T::Array[
32
+ [T.nilable(Symbol), T.anything, Turbopuffer::Internal::AnyHash]
33
+ ]
34
+ )
35
+ end
29
36
  protected def derefed_variants
30
37
  end
31
38
 
@@ -69,6 +69,14 @@ module Turbopuffer
69
69
  sig { params(filters: T.anything).void }
70
70
  attr_writer :filters
71
71
 
72
+ # Groups documents by the specified attributes (the "group key") before computing
73
+ # aggregates. Aggregates are computed separately for each group.
74
+ sig { returns(T.nilable(T::Array[String])) }
75
+ attr_reader :group_by
76
+
77
+ sig { params(group_by: T::Array[String]).void }
78
+ attr_writer :group_by
79
+
72
80
  # Whether to include attributes in the response.
73
81
  sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
74
82
  attr_reader :include_attributes
@@ -112,6 +120,7 @@ module Turbopuffer
112
120
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
113
121
  exclude_attributes: T::Array[String],
114
122
  filters: T.anything,
123
+ group_by: T::Array[String],
115
124
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
116
125
  rank_by: T.anything,
117
126
  top_k: Integer,
@@ -134,6 +143,9 @@ module Turbopuffer
134
143
  # Exact filters for attributes to refine search results for. Think of it as a SQL
135
144
  # WHERE clause.
136
145
  filters: nil,
146
+ # Groups documents by the specified attributes (the "group key") before computing
147
+ # aggregates. Aggregates are computed separately for each group.
148
+ group_by: nil,
137
149
  # Whether to include attributes in the response.
138
150
  include_attributes: nil,
139
151
  # How to rank the documents in the namespace.
@@ -155,6 +167,7 @@ module Turbopuffer
155
167
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
156
168
  exclude_attributes: T::Array[String],
157
169
  filters: T.anything,
170
+ group_by: T::Array[String],
158
171
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
159
172
  rank_by: T.anything,
160
173
  top_k: Integer,
@@ -26,7 +26,7 @@ module Turbopuffer
26
26
  def self.new(
27
27
  message: nil,
28
28
  # The status of the request.
29
- status: :OK
29
+ status: :ACCEPTED
30
30
  )
31
31
  end
32
32
 
@@ -74,6 +74,14 @@ module Turbopuffer
74
74
  )
75
75
  end
76
76
 
77
+ sig { returns(T.nilable(T::Array[Turbopuffer::Row])) }
78
+ attr_reader :aggregation_groups
79
+
80
+ sig do
81
+ params(aggregation_groups: T::Array[Turbopuffer::Row::OrHash]).void
82
+ end
83
+ attr_writer :aggregation_groups
84
+
77
85
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
78
86
  attr_reader :aggregations
79
87
 
@@ -88,16 +96,18 @@ module Turbopuffer
88
96
 
89
97
  sig do
90
98
  params(
99
+ aggregation_groups: T::Array[Turbopuffer::Row::OrHash],
91
100
  aggregations: T::Hash[Symbol, T.anything],
92
101
  rows: T::Array[Turbopuffer::Row::OrHash]
93
102
  ).returns(T.attached_class)
94
103
  end
95
- def self.new(aggregations: nil, rows: nil)
104
+ def self.new(aggregation_groups: nil, aggregations: nil, rows: nil)
96
105
  end
97
106
 
98
107
  sig do
99
108
  override.returns(
100
109
  {
110
+ aggregation_groups: T::Array[Turbopuffer::Row],
101
111
  aggregations: T::Hash[Symbol, T.anything],
102
112
  rows: T::Array[Turbopuffer::Row]
103
113
  }
@@ -64,6 +64,14 @@ module Turbopuffer
64
64
  sig { params(filters: T.anything).void }
65
65
  attr_writer :filters
66
66
 
67
+ # Groups documents by the specified attributes (the "group key") before computing
68
+ # aggregates. Aggregates are computed separately for each group.
69
+ sig { returns(T.nilable(T::Array[String])) }
70
+ attr_reader :group_by
71
+
72
+ sig { params(group_by: T::Array[String]).void }
73
+ attr_writer :group_by
74
+
67
75
  # Whether to include attributes in the response.
68
76
  sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
69
77
  attr_reader :include_attributes
@@ -106,6 +114,7 @@ module Turbopuffer
106
114
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
107
115
  exclude_attributes: T::Array[String],
108
116
  filters: T.anything,
117
+ group_by: T::Array[String],
109
118
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
110
119
  rank_by: T.anything,
111
120
  top_k: Integer,
@@ -128,6 +137,9 @@ module Turbopuffer
128
137
  # Exact filters for attributes to refine search results for. Think of it as a SQL
129
138
  # WHERE clause.
130
139
  filters: nil,
140
+ # Groups documents by the specified attributes (the "group key") before computing
141
+ # aggregates. Aggregates are computed separately for each group.
142
+ group_by: nil,
131
143
  # Whether to include attributes in the response.
132
144
  include_attributes: nil,
133
145
  # How to rank the documents in the namespace.
@@ -149,6 +161,7 @@ module Turbopuffer
149
161
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
150
162
  exclude_attributes: T::Array[String],
151
163
  filters: T.anything,
164
+ group_by: T::Array[String],
152
165
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
153
166
  rank_by: T.anything,
154
167
  top_k: Integer,
@@ -25,6 +25,14 @@ module Turbopuffer
25
25
  sig { params(performance: Turbopuffer::QueryPerformance::OrHash).void }
26
26
  attr_writer :performance
27
27
 
28
+ sig { returns(T.nilable(T::Array[Turbopuffer::Row])) }
29
+ attr_reader :aggregation_groups
30
+
31
+ sig do
32
+ params(aggregation_groups: T::Array[Turbopuffer::Row::OrHash]).void
33
+ end
34
+ attr_writer :aggregation_groups
35
+
28
36
  sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
29
37
  attr_reader :aggregations
30
38
 
@@ -42,6 +50,7 @@ module Turbopuffer
42
50
  params(
43
51
  billing: Turbopuffer::QueryBilling::OrHash,
44
52
  performance: Turbopuffer::QueryPerformance::OrHash,
53
+ aggregation_groups: T::Array[Turbopuffer::Row::OrHash],
45
54
  aggregations: T::Hash[Symbol, T.anything],
46
55
  rows: T::Array[Turbopuffer::Row::OrHash]
47
56
  ).returns(T.attached_class)
@@ -51,6 +60,7 @@ module Turbopuffer
51
60
  billing:,
52
61
  # The performance information for a query.
53
62
  performance:,
63
+ aggregation_groups: nil,
54
64
  aggregations: nil,
55
65
  rows: nil
56
66
  )
@@ -61,6 +71,7 @@ module Turbopuffer
61
71
  {
62
72
  billing: Turbopuffer::QueryBilling,
63
73
  performance: Turbopuffer::QueryPerformance,
74
+ aggregation_groups: T::Array[Turbopuffer::Row],
64
75
  aggregations: T::Hash[Symbol, T.anything],
65
76
  rows: T::Array[Turbopuffer::Row]
66
77
  }
@@ -41,6 +41,14 @@ module Turbopuffer
41
41
  sig { params(filters: T.anything).void }
42
42
  attr_writer :filters
43
43
 
44
+ # Groups documents by the specified attributes (the "group key") before computing
45
+ # aggregates. Aggregates are computed separately for each group.
46
+ sig { returns(T.nilable(T::Array[String])) }
47
+ attr_reader :group_by
48
+
49
+ sig { params(group_by: T::Array[String]).void }
50
+ attr_writer :group_by
51
+
44
52
  # Whether to include attributes in the response.
45
53
  sig { returns(T.nilable(Turbopuffer::IncludeAttributes::Variants)) }
46
54
  attr_reader :include_attributes
@@ -73,6 +81,7 @@ module Turbopuffer
73
81
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
74
82
  exclude_attributes: T::Array[String],
75
83
  filters: T.anything,
84
+ group_by: T::Array[String],
76
85
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
77
86
  rank_by: T.anything,
78
87
  top_k: Integer
@@ -90,6 +99,9 @@ module Turbopuffer
90
99
  # Exact filters for attributes to refine search results for. Think of it as a SQL
91
100
  # WHERE clause.
92
101
  filters: nil,
102
+ # Groups documents by the specified attributes (the "group key") before computing
103
+ # aggregates. Aggregates are computed separately for each group.
104
+ group_by: nil,
93
105
  # Whether to include attributes in the response.
94
106
  include_attributes: nil,
95
107
  # How to rank the documents in the namespace.
@@ -106,6 +118,7 @@ module Turbopuffer
106
118
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
107
119
  exclude_attributes: T::Array[String],
108
120
  filters: T.anything,
121
+ group_by: T::Array[String],
109
122
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
110
123
  rank_by: T.anything,
111
124
  top_k: Integer
@@ -27,6 +27,7 @@ module Turbopuffer
27
27
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
28
28
  exclude_attributes: T::Array[String],
29
29
  filters: T.anything,
30
+ group_by: T::Array[String],
30
31
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
31
32
  rank_by: T.anything,
32
33
  top_k: Integer,
@@ -50,6 +51,9 @@ module Turbopuffer
50
51
  # Body param: Exact filters for attributes to refine search results for. Think of
51
52
  # it as a SQL WHERE clause.
52
53
  filters: nil,
54
+ # Body param: Groups documents by the specified attributes (the "group key")
55
+ # before computing aggregates. Aggregates are computed separately for each group.
56
+ group_by: nil,
53
57
  # Body param: Whether to include attributes in the response.
54
58
  include_attributes: nil,
55
59
  # Body param: How to rank the documents in the namespace.
@@ -123,6 +127,7 @@ module Turbopuffer
123
127
  distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
124
128
  exclude_attributes: T::Array[String],
125
129
  filters: T.anything,
130
+ group_by: T::Array[String],
126
131
  include_attributes: Turbopuffer::IncludeAttributes::Variants,
127
132
  rank_by: T.anything,
128
133
  top_k: Integer,
@@ -146,6 +151,9 @@ module Turbopuffer
146
151
  # Body param: Exact filters for attributes to refine search results for. Think of
147
152
  # it as a SQL WHERE clause.
148
153
  filters: nil,
154
+ # Body param: Groups documents by the specified attributes (the "group key")
155
+ # before computing aggregates. Aggregates are computed separately for each group.
156
+ group_by: nil,
149
157
  # Body param: Whether to include attributes in the response.
150
158
  include_attributes: nil,
151
159
  # Body param: How to rank the documents in the namespace.
@@ -39,6 +39,23 @@ module Turbopuffer
39
39
  | Turbopuffer::Internal::Type::Converter::input spec
40
40
  ) -> (^-> top)
41
41
 
42
+ def self.meta_info: (
43
+ {
44
+ const: (nil | bool | Integer | Float | Symbol)?,
45
+ enum: ^-> Turbopuffer::Internal::Type::Converter::input?,
46
+ union: ^-> Turbopuffer::Internal::Type::Converter::input?
47
+ }
48
+ | ^-> Turbopuffer::Internal::Type::Converter::input
49
+ | Turbopuffer::Internal::Type::Converter::input type_info,
50
+ {
51
+ const: (nil | bool | Integer | Float | Symbol)?,
52
+ enum: ^-> Turbopuffer::Internal::Type::Converter::input?,
53
+ union: ^-> Turbopuffer::Internal::Type::Converter::input?
54
+ }
55
+ | ^-> Turbopuffer::Internal::Type::Converter::input
56
+ | Turbopuffer::Internal::Type::Converter::input spec
57
+ ) -> ::Hash[Symbol, top]
58
+
42
59
  def self.new_coerce_state: (
43
60
  ?translate_names: bool
44
61
  ) -> Turbopuffer::Internal::Type::Converter::coerce_state
@@ -5,9 +5,9 @@ module Turbopuffer
5
5
  include Turbopuffer::Internal::Type::Converter
6
6
  include Turbopuffer::Internal::Util::SorbetRuntimeSupport
7
7
 
8
- private def self.known_variants: -> ::Array[[Symbol?, (^-> Turbopuffer::Internal::Type::Converter::input)]]
8
+ private def self.known_variants: -> ::Array[[Symbol?, (^-> Turbopuffer::Internal::Type::Converter::input), ::Hash[Symbol, top]]]
9
9
 
10
- def self.derefed_variants: -> ::Array[[Symbol?, top]]
10
+ def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]]
11
11
 
12
12
  def self.variants: -> ::Array[top]
13
13
 
@@ -8,6 +8,7 @@ module Turbopuffer
8
8
  distance_metric: Turbopuffer::Models::distance_metric,
9
9
  exclude_attributes: ::Array[String],
10
10
  filters: top,
11
+ group_by: ::Array[String],
11
12
  include_attributes: Turbopuffer::Models::include_attributes,
12
13
  rank_by: top,
13
14
  top_k: Integer,
@@ -47,6 +48,10 @@ module Turbopuffer
47
48
 
48
49
  def filters=: (top) -> top
49
50
 
51
+ attr_reader group_by: ::Array[String]?
52
+
53
+ def group_by=: (::Array[String]) -> ::Array[String]
54
+
50
55
  attr_reader include_attributes: Turbopuffer::Models::include_attributes?
51
56
 
52
57
  def include_attributes=: (
@@ -74,6 +79,7 @@ module Turbopuffer
74
79
  ?distance_metric: Turbopuffer::Models::distance_metric,
75
80
  ?exclude_attributes: ::Array[String],
76
81
  ?filters: top,
82
+ ?group_by: ::Array[String],
77
83
  ?include_attributes: Turbopuffer::Models::include_attributes,
78
84
  ?rank_by: top,
79
85
  ?top_k: Integer,
@@ -88,6 +94,7 @@ module Turbopuffer
88
94
  distance_metric: Turbopuffer::Models::distance_metric,
89
95
  exclude_attributes: ::Array[String],
90
96
  filters: top,
97
+ group_by: ::Array[String],
91
98
  include_attributes: Turbopuffer::Models::include_attributes,
92
99
  rank_by: top,
93
100
  top_k: Integer,
@@ -1,17 +1,18 @@
1
1
  module Turbopuffer
2
2
  module Models
3
- type namespace_hint_cache_warm_response = { status: :OK, message: String }
3
+ type namespace_hint_cache_warm_response =
4
+ { status: :ACCEPTED, message: String }
4
5
 
5
6
  class NamespaceHintCacheWarmResponse < Turbopuffer::Internal::Type::BaseModel
6
- attr_accessor status: :OK
7
+ attr_accessor status: :ACCEPTED
7
8
 
8
9
  attr_reader message: String?
9
10
 
10
11
  def message=: (String) -> String
11
12
 
12
- def initialize: (?message: String, ?status: :OK) -> void
13
+ def initialize: (?message: String, ?status: :ACCEPTED) -> void
13
14
 
14
- def to_hash: -> { status: :OK, message: String }
15
+ def to_hash: -> { status: :ACCEPTED, message: String }
15
16
  end
16
17
  end
17
18
  end
@@ -27,9 +27,19 @@ module Turbopuffer
27
27
  }
28
28
 
29
29
  type result =
30
- { aggregations: ::Hash[Symbol, top], rows: ::Array[Turbopuffer::Row] }
30
+ {
31
+ aggregation_groups: ::Array[Turbopuffer::Row],
32
+ aggregations: ::Hash[Symbol, top],
33
+ rows: ::Array[Turbopuffer::Row]
34
+ }
31
35
 
32
36
  class Result < Turbopuffer::Internal::Type::BaseModel
37
+ attr_reader aggregation_groups: ::Array[Turbopuffer::Row]?
38
+
39
+ def aggregation_groups=: (
40
+ ::Array[Turbopuffer::Row]
41
+ ) -> ::Array[Turbopuffer::Row]
42
+
33
43
  attr_reader aggregations: ::Hash[Symbol, top]?
34
44
 
35
45
  def aggregations=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
@@ -39,11 +49,13 @@ module Turbopuffer
39
49
  def rows=: (::Array[Turbopuffer::Row]) -> ::Array[Turbopuffer::Row]
40
50
 
41
51
  def initialize: (
52
+ ?aggregation_groups: ::Array[Turbopuffer::Row],
42
53
  ?aggregations: ::Hash[Symbol, top],
43
54
  ?rows: ::Array[Turbopuffer::Row]
44
55
  ) -> void
45
56
 
46
57
  def to_hash: -> {
58
+ aggregation_groups: ::Array[Turbopuffer::Row],
47
59
  aggregations: ::Hash[Symbol, top],
48
60
  rows: ::Array[Turbopuffer::Row]
49
61
  }
@@ -8,6 +8,7 @@ module Turbopuffer
8
8
  distance_metric: Turbopuffer::Models::distance_metric,
9
9
  exclude_attributes: ::Array[String],
10
10
  filters: top,
11
+ group_by: ::Array[String],
11
12
  include_attributes: Turbopuffer::Models::include_attributes,
12
13
  rank_by: top,
13
14
  top_k: Integer,
@@ -47,6 +48,10 @@ module Turbopuffer
47
48
 
48
49
  def filters=: (top) -> top
49
50
 
51
+ attr_reader group_by: ::Array[String]?
52
+
53
+ def group_by=: (::Array[String]) -> ::Array[String]
54
+
50
55
  attr_reader include_attributes: Turbopuffer::Models::include_attributes?
51
56
 
52
57
  def include_attributes=: (
@@ -74,6 +79,7 @@ module Turbopuffer
74
79
  ?distance_metric: Turbopuffer::Models::distance_metric,
75
80
  ?exclude_attributes: ::Array[String],
76
81
  ?filters: top,
82
+ ?group_by: ::Array[String],
77
83
  ?include_attributes: Turbopuffer::Models::include_attributes,
78
84
  ?rank_by: top,
79
85
  ?top_k: Integer,
@@ -88,6 +94,7 @@ module Turbopuffer
88
94
  distance_metric: Turbopuffer::Models::distance_metric,
89
95
  exclude_attributes: ::Array[String],
90
96
  filters: top,
97
+ group_by: ::Array[String],
91
98
  include_attributes: Turbopuffer::Models::include_attributes,
92
99
  rank_by: top,
93
100
  top_k: Integer,
@@ -4,6 +4,7 @@ module Turbopuffer
4
4
  {
5
5
  billing: Turbopuffer::QueryBilling,
6
6
  performance: Turbopuffer::QueryPerformance,
7
+ aggregation_groups: ::Array[Turbopuffer::Row],
7
8
  aggregations: ::Hash[Symbol, top],
8
9
  rows: ::Array[Turbopuffer::Row]
9
10
  }
@@ -13,6 +14,12 @@ module Turbopuffer
13
14
 
14
15
  attr_accessor performance: Turbopuffer::QueryPerformance
15
16
 
17
+ attr_reader aggregation_groups: ::Array[Turbopuffer::Row]?
18
+
19
+ def aggregation_groups=: (
20
+ ::Array[Turbopuffer::Row]
21
+ ) -> ::Array[Turbopuffer::Row]
22
+
16
23
  attr_reader aggregations: ::Hash[Symbol, top]?
17
24
 
18
25
  def aggregations=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
@@ -24,6 +31,7 @@ module Turbopuffer
24
31
  def initialize: (
25
32
  billing: Turbopuffer::QueryBilling,
26
33
  performance: Turbopuffer::QueryPerformance,
34
+ ?aggregation_groups: ::Array[Turbopuffer::Row],
27
35
  ?aggregations: ::Hash[Symbol, top],
28
36
  ?rows: ::Array[Turbopuffer::Row]
29
37
  ) -> void
@@ -31,6 +39,7 @@ module Turbopuffer
31
39
  def to_hash: -> {
32
40
  billing: Turbopuffer::QueryBilling,
33
41
  performance: Turbopuffer::QueryPerformance,
42
+ aggregation_groups: ::Array[Turbopuffer::Row],
34
43
  aggregations: ::Hash[Symbol, top],
35
44
  rows: ::Array[Turbopuffer::Row]
36
45
  }
@@ -6,6 +6,7 @@ module Turbopuffer
6
6
  distance_metric: Turbopuffer::Models::distance_metric,
7
7
  exclude_attributes: ::Array[String],
8
8
  filters: top,
9
+ group_by: ::Array[String],
9
10
  include_attributes: Turbopuffer::Models::include_attributes,
10
11
  rank_by: top,
11
12
  top_k: Integer
@@ -30,6 +31,10 @@ module Turbopuffer
30
31
 
31
32
  def filters=: (top) -> top
32
33
 
34
+ attr_reader group_by: ::Array[String]?
35
+
36
+ def group_by=: (::Array[String]) -> ::Array[String]
37
+
33
38
  attr_reader include_attributes: Turbopuffer::Models::include_attributes?
34
39
 
35
40
  def include_attributes=: (
@@ -49,6 +54,7 @@ module Turbopuffer
49
54
  ?distance_metric: Turbopuffer::Models::distance_metric,
50
55
  ?exclude_attributes: ::Array[String],
51
56
  ?filters: top,
57
+ ?group_by: ::Array[String],
52
58
  ?include_attributes: Turbopuffer::Models::include_attributes,
53
59
  ?rank_by: top,
54
60
  ?top_k: Integer
@@ -59,6 +65,7 @@ module Turbopuffer
59
65
  distance_metric: Turbopuffer::Models::distance_metric,
60
66
  exclude_attributes: ::Array[String],
61
67
  filters: top,
68
+ group_by: ::Array[String],
62
69
  include_attributes: Turbopuffer::Models::include_attributes,
63
70
  rank_by: top,
64
71
  top_k: Integer
@@ -13,6 +13,7 @@ module Turbopuffer
13
13
  ?distance_metric: Turbopuffer::Models::distance_metric,
14
14
  ?exclude_attributes: ::Array[String],
15
15
  ?filters: top,
16
+ ?group_by: ::Array[String],
16
17
  ?include_attributes: Turbopuffer::Models::include_attributes,
17
18
  ?rank_by: top,
18
19
  ?top_k: Integer,
@@ -45,6 +46,7 @@ module Turbopuffer
45
46
  ?distance_metric: Turbopuffer::Models::distance_metric,
46
47
  ?exclude_attributes: ::Array[String],
47
48
  ?filters: top,
49
+ ?group_by: ::Array[String],
48
50
  ?include_attributes: Turbopuffer::Models::include_attributes,
49
51
  ?rank_by: top,
50
52
  ?top_k: Integer,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbopuffer-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Turbopuffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-08 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool