turbopuffer-ruby 0.2.5 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26c8d39f36226c564b9378cfe4b392aeb400b6276c5fbfe7d60613b6fc33bd39
4
- data.tar.gz: 9b246312e930c3d27c136e31fc211b8043c4e5547324bd5ba1a7e8c5f8609c35
3
+ metadata.gz: e68ecf643e3ef570edf2c61bfb412c27d9c2c17fbaf5e4c614c7d5aa2afa3e05
4
+ data.tar.gz: '095f4ccefed27b4a1479ecdb5c10a88a7a2017f1aa4f25188c321b206765aba4'
5
5
  SHA512:
6
- metadata.gz: 8c39ed7f28513d70e15b7f1d270272a2fe880ef22b2a79e2b48c2bfad34bf50d59c972a94afb0fe71527618e7bd793cdc764178ccd2dc88fd184103a0085b8d1
7
- data.tar.gz: bb6a174358d9416ecba3ad7add3ca805cbc6ae929183a4bbfa79e96b8dc01c4a2ec4e7287bab35b89b68c36622bdc25e154bc165f2e13aa8a39ac19125c6be49
6
+ metadata.gz: febffe23d0069251a67e807e34cb502bf9a40bd819e755c72a7c6c369898143145767c6fb8362c2e66138247abc9886dd04154c37be11aeaf20cb05230249314
7
+ data.tar.gz: d6be41a93adaf04d4c3eacb77ff1e9efff4fe2d38ad616f5d70da99b5e8834f31c9babded64d1a1f84645d6a4fc9146bbb625647890ad1adbe1683ecaf24b41b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
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
+
3
17
  ## 0.2.5 (2025-08-11)
4
18
 
5
19
  Full Changelog: [v0.2.4...v0.2.5](https://github.com/turbopuffer/turbopuffer-ruby/compare/v0.2.4...v0.2.5)
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.5"
20
+ gem "turbopuffer-ruby", "~> 0.2.6"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-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.5"
4
+ VERSION = "0.2.6"
5
5
  end
@@ -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.
@@ -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.5
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-11 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