turbopuffer 2.2.0 → 2.4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/README.md +3 -3
- data/lib/turbopuffer/internal/transport/base_client.rb +4 -1
- data/lib/turbopuffer/models/attribute_schema_config.rb +14 -1
- data/lib/turbopuffer/models/highlight_config_params.rb +46 -0
- data/lib/turbopuffer/models/highlight_fragment_by.rb +25 -0
- data/lib/turbopuffer/models/highlight_offset_units.rb +17 -0
- data/lib/turbopuffer/models/namespace_copy_from_params.rb +9 -1
- data/lib/turbopuffer/models/namespace_explain_query_params.rb +11 -1
- data/lib/turbopuffer/models/namespace_metadata.rb +12 -1
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +11 -1
- data/lib/turbopuffer/models/namespace_query_params.rb +11 -1
- data/lib/turbopuffer/models/namespace_write_params.rb +12 -1
- data/lib/turbopuffer/models/rrf_params.rb +14 -1
- data/lib/turbopuffer/models/sharding_config.rb +21 -0
- data/lib/turbopuffer/models.rb +8 -0
- data/lib/turbopuffer/resources/namespaces.rb +12 -4
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +4 -0
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +20 -3
- data/rbi/turbopuffer/models/highlight_config_params.rbi +85 -0
- data/rbi/turbopuffer/models/highlight_fragment_by.rbi +36 -0
- data/rbi/turbopuffer/models/highlight_offset_units.rbi +27 -0
- data/rbi/turbopuffer/models/namespace_copy_from_params.rbi +36 -0
- data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +15 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +20 -3
- data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +15 -0
- data/rbi/turbopuffer/models/namespace_query_params.rbi +15 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +17 -0
- data/rbi/turbopuffer/models/rrf_params.rbi +22 -3
- data/rbi/turbopuffer/models/sharding_config.rbi +31 -0
- data/rbi/turbopuffer/models.rbi +8 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +24 -0
- data/sig/turbopuffer/models/attribute_schema_config.rbs +12 -3
- data/sig/turbopuffer/models/highlight_config_params.rbs +47 -0
- data/sig/turbopuffer/models/highlight_fragment_by.rbs +23 -0
- data/sig/turbopuffer/models/highlight_offset_units.rbs +15 -0
- data/sig/turbopuffer/models/namespace_copy_from_params.rbs +9 -0
- data/sig/turbopuffer/models/namespace_explain_query_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +12 -3
- data/sig/turbopuffer/models/namespace_multi_query_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +7 -0
- data/sig/turbopuffer/models/namespace_write_params.rbs +9 -0
- data/sig/turbopuffer/models/rrf_params.rbs +10 -3
- data/sig/turbopuffer/models/sharding_config.rbs +13 -0
- data/sig/turbopuffer/models.rbs +8 -0
- data/sig/turbopuffer/resources/namespaces.rbs +4 -0
- metadata +14 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 261de656879e46b1d9f2261ccd91ff7ea9e266d8a86607c5395ad55f38733dcf
|
|
4
|
+
data.tar.gz: f747583237835002c070734cd7a3955c9476df205d5815e3fcf04ee10e9a8a76
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bc98d5c9e8d49f32361220486d44837ae507de3693b375b40d8ba6a668c9897efdeb60372d93da15a10493ca7a3b999c0962e7809ccd42514ec4c52230e96c8
|
|
7
|
+
data.tar.gz: 022a2361e31a953a68d1867c5cc67ce571556e126ad873267ef2beb28ccf0e81438681570c86955134514a574c6812c374036b61fd5b0c88d8e642e62eb33c88
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.4.0 (2026-07-30)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.3.0...v2.4.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.3.0...v2.4.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* openapi: add RRF `weights` parameter ([621628b](https://github.com/turbopuffer/turbopuffer-ruby/commit/621628bc8d9ed54a0ab5006c20ba5f4ae03e966e))
|
|
10
|
+
* spec: add sharding config to the openapi spec ([2228a03](https://github.com/turbopuffer/turbopuffer-ruby/commit/2228a031201ad1b3d20ae1c77d029d665c67e428))
|
|
11
|
+
* spec: expose computed attributes ([597fdde](https://github.com/turbopuffer/turbopuffer-ruby/commit/597fdde888efd50b9873b056ab0c12fab5a9e600))
|
|
12
|
+
* spec: hide HighlightConfig.rank_fragments_by's RankBy ref from Stainless ([59c2734](https://github.com/turbopuffer/turbopuffer-ruby/commit/59c273482fcfccce1fc8f4d8b8d3ae13c0fbbcdc))
|
|
13
|
+
* spec: make compute_attributes value x-stainless-any ([c170466](https://github.com/turbopuffer/turbopuffer-ruby/commit/c17046653f2533e00e9129d4e807a5ab2c3b1cd6))
|
|
14
|
+
* spec: rename HighlightConfig -> HighlightConfigParams ([36413c3](https://github.com/turbopuffer/turbopuffer-ruby/commit/36413c3bebab413e60ab51ba728437e66edaa7ab))
|
|
15
|
+
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([12b486b](https://github.com/turbopuffer/turbopuffer-ruby/commit/12b486b953bf4521f18eb1187ba20812d30b3cfd))
|
|
16
|
+
* support late_interaction parameter in sdks ([ac90617](https://github.com/turbopuffer/turbopuffer-ruby/commit/ac9061734ae8f47e823c20f381bf925c27634d8e))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
|
|
21
|
+
* **internal:** bound formatter parallelism to CPU count ([a56e5af](https://github.com/turbopuffer/turbopuffer-ruby/commit/a56e5af20b69bd39b12fbf2e9db2cd6d9b1b1ee8))
|
|
22
|
+
* remove unused MCP package ([2b81b9a](https://github.com/turbopuffer/turbopuffer-ruby/commit/2b81b9ae116370e14cf1213e056b147277e6cca3))
|
|
23
|
+
|
|
24
|
+
## 2.3.0 (2026-06-16)
|
|
25
|
+
|
|
26
|
+
Full Changelog: [v2.2.0...v2.3.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.2.0...v2.3.0)
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* tpuf-engine: support dest_encryption in copy_from_namespace ([ef8ce32](https://github.com/turbopuffer/turbopuffer-ruby/commit/ef8ce322607fe8fd30b259d5012582b776ec1b09))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* **client:** send content-type header for requests with an omitted optional body ([d2c5ed1](https://github.com/turbopuffer/turbopuffer-ruby/commit/d2c5ed1ec19aa3c371c1bce215f9b77ac5910dd7))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Documentation
|
|
39
|
+
|
|
40
|
+
* rename /docs/overview to /docs/api-overview ([c049a0c](https://github.com/turbopuffer/turbopuffer-ruby/commit/c049a0c4a712f9de2081da5f387a8036acc04fcf))
|
|
41
|
+
|
|
3
42
|
## 2.2.0 (2026-06-08)
|
|
4
43
|
|
|
5
44
|
Full Changelog: [v2.1.0...v2.2.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.1.0...v2.2.0)
|
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@ It is generated with [Stainless](https://www.stainless.com/).
|
|
|
6
6
|
|
|
7
7
|
## MCP Server
|
|
8
8
|
|
|
9
|
-
Use the
|
|
9
|
+
Use the Turbopuffer MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
10
10
|
|
|
11
11
|
[](https://cursor.com/en-US/install-mcp?name=%40turbopuffer%2Fturbopuffer-mcp&config=eyJuYW1lIjoiQHR1cmJvcHVmZmVyL3R1cmJvcHVmZmVyLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL3R1cmJvcHVmZmVyLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtdHVyYm9wdWZmZXItYXBpLWtleSI6InRwdWZfQTEuLi4ifX0)
|
|
12
12
|
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40turbopuffer%2Fturbopuffer-mcp%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fturbopuffer.stlmcp.com%22%2C%22headers%22%3A%7B%22x-turbopuffer-api-key%22%3A%22tpuf_A1...%22%7D%7D)
|
|
@@ -17,7 +17,7 @@ Use the turbopuffer MCP Server to enable AI assistants to interact with this API
|
|
|
17
17
|
|
|
18
18
|
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/turbopuffer).
|
|
19
19
|
|
|
20
|
-
The REST API documentation can be found at [turbopuffer.com/docs/overview](https://turbopuffer.com/docs/overview).
|
|
20
|
+
The REST API documentation can be found at [turbopuffer.com/docs/api-overview](https://turbopuffer.com/docs/api-overview).
|
|
21
21
|
|
|
22
22
|
## Installation
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
26
26
|
<!-- x-release-please-start-version -->
|
|
27
27
|
|
|
28
28
|
```ruby
|
|
29
|
-
gem "turbopuffer", "~> 2.
|
|
29
|
+
gem "turbopuffer", "~> 2.4.0"
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<!-- x-release-please-end -->
|
|
@@ -321,7 +321,10 @@ module Turbopuffer
|
|
|
321
321
|
Turbopuffer::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
|
|
322
322
|
end
|
|
323
323
|
|
|
324
|
-
|
|
324
|
+
# Generated methods always pass `req[:body]` for operations that define a
|
|
325
|
+
# request body, so only elide the content-type header when the operation
|
|
326
|
+
# has no body at all, not when an optional body param was omitted.
|
|
327
|
+
headers.delete("content-type") if body.nil? && !req.key?(:body)
|
|
325
328
|
|
|
326
329
|
url = Turbopuffer::Internal::Util.join_parsed_uri(
|
|
327
330
|
@base_url_components,
|
|
@@ -108,10 +108,23 @@ module Turbopuffer
|
|
|
108
108
|
# @return [Symbol, Turbopuffer::Models::DistanceMetric, nil]
|
|
109
109
|
optional :distance_metric, enum: -> { Turbopuffer::DistanceMetric }
|
|
110
110
|
|
|
111
|
-
# @!
|
|
111
|
+
# @!attribute late_interaction
|
|
112
|
+
# Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
|
|
113
|
+
# vector array attributes, and is required to enable an ANN index on such
|
|
114
|
+
# attributes. Defaults to `false`.
|
|
115
|
+
#
|
|
116
|
+
# @return [Boolean, nil]
|
|
117
|
+
optional :late_interaction, Turbopuffer::Internal::Type::Boolean
|
|
118
|
+
|
|
119
|
+
# @!method initialize(distance_metric: nil, late_interaction: nil)
|
|
120
|
+
# Some parameter documentations has been truncated, see
|
|
121
|
+
# {Turbopuffer::Models::AttributeSchemaConfig::Ann::AnnConfig} for more details.
|
|
122
|
+
#
|
|
112
123
|
# Configuration options for ANN (Approximate Nearest Neighbor) indexing.
|
|
113
124
|
#
|
|
114
125
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
126
|
+
#
|
|
127
|
+
# @param late_interaction [Boolean] Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
|
|
115
128
|
end
|
|
116
129
|
|
|
117
130
|
# @!method self.variants
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
class HighlightConfigParams < Turbopuffer::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute fragment_by
|
|
7
|
+
# How to split a text attribute into fragments for highlighting.
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, Turbopuffer::Models::HighlightFragmentBy, nil]
|
|
10
|
+
optional :fragment_by, enum: -> { Turbopuffer::HighlightFragmentBy }
|
|
11
|
+
|
|
12
|
+
# @!attribute fragment_limit
|
|
13
|
+
# The maximum number of fragments to return. Defaults to `3`.
|
|
14
|
+
#
|
|
15
|
+
# @return [Integer, nil]
|
|
16
|
+
optional :fragment_limit, Integer
|
|
17
|
+
|
|
18
|
+
# @!attribute include_offsets
|
|
19
|
+
# The units to report highlighted fragment offsets in.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, Turbopuffer::Models::HighlightOffsetUnits, nil]
|
|
22
|
+
optional :include_offsets, enum: -> { Turbopuffer::HighlightOffsetUnits }
|
|
23
|
+
|
|
24
|
+
# @!attribute rank_fragments_by
|
|
25
|
+
# How to rank candidate fragments within the attribute before selecting the top
|
|
26
|
+
# `fragment_limit`. Defaults to the query's `rank_by`.
|
|
27
|
+
#
|
|
28
|
+
# @return [Object, nil]
|
|
29
|
+
optional :rank_fragments_by, Turbopuffer::Internal::Type::Unknown
|
|
30
|
+
|
|
31
|
+
# @!method initialize(fragment_by: nil, fragment_limit: nil, include_offsets: nil, rank_fragments_by: nil)
|
|
32
|
+
# Some parameter documentations has been truncated, see
|
|
33
|
+
# {Turbopuffer::Models::HighlightConfigParams} for more details.
|
|
34
|
+
#
|
|
35
|
+
# Additional (optional) parameters for the Highlight compute expression.
|
|
36
|
+
#
|
|
37
|
+
# @param fragment_by [Symbol, Turbopuffer::Models::HighlightFragmentBy] How to split a text attribute into fragments for highlighting.
|
|
38
|
+
#
|
|
39
|
+
# @param fragment_limit [Integer] The maximum number of fragments to return. Defaults to `3`.
|
|
40
|
+
#
|
|
41
|
+
# @param include_offsets [Symbol, Turbopuffer::Models::HighlightOffsetUnits] The units to report highlighted fragment offsets in.
|
|
42
|
+
#
|
|
43
|
+
# @param rank_fragments_by [Object] How to rank candidate fragments within the attribute before selecting the top `f
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
# How to split a text attribute into fragments for highlighting.
|
|
6
|
+
module HighlightFragmentBy
|
|
7
|
+
extend Turbopuffer::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
# Treat the whole attribute as a single fragment.
|
|
10
|
+
NONE = :none
|
|
11
|
+
|
|
12
|
+
# Split the attribute into sentences. This is the default.
|
|
13
|
+
SENTENCE = :sentence
|
|
14
|
+
|
|
15
|
+
# Split the attribute into paragraphs.
|
|
16
|
+
PARAGRAPH = :paragraph
|
|
17
|
+
|
|
18
|
+
# Split the attribute into individual words.
|
|
19
|
+
WORD = :word
|
|
20
|
+
|
|
21
|
+
# @!method self.values
|
|
22
|
+
# @return [Array<Symbol>]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
# The units to report highlighted fragment offsets in.
|
|
6
|
+
module HighlightOffsetUnits
|
|
7
|
+
extend Turbopuffer::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
UTF_8 = :"utf-8"
|
|
10
|
+
UTF_16 = :"utf-16"
|
|
11
|
+
CODEPOINTS = :codepoints
|
|
12
|
+
|
|
13
|
+
# @!method self.values
|
|
14
|
+
# @return [Array<Symbol>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -18,6 +18,12 @@ module Turbopuffer
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
required :source_namespace, String
|
|
20
20
|
|
|
21
|
+
# @!attribute dest_encryption
|
|
22
|
+
# (Optional) The encryption configuration for the destination namespace.
|
|
23
|
+
#
|
|
24
|
+
# @return [Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default, nil]
|
|
25
|
+
optional :dest_encryption, union: -> { Turbopuffer::Encryption }
|
|
26
|
+
|
|
21
27
|
# @!attribute source_api_key
|
|
22
28
|
# (Optional) An API key for the organization containing the source namespace
|
|
23
29
|
#
|
|
@@ -30,11 +36,13 @@ module Turbopuffer
|
|
|
30
36
|
# @return [String, nil]
|
|
31
37
|
optional :source_region, String
|
|
32
38
|
|
|
33
|
-
# @!method initialize(source_namespace:, namespace: nil, source_api_key: nil, source_region: nil, request_options: {})
|
|
39
|
+
# @!method initialize(source_namespace:, namespace: nil, dest_encryption: nil, source_api_key: nil, source_region: nil, request_options: {})
|
|
34
40
|
# @param source_namespace [String] The namespace to copy documents from.
|
|
35
41
|
#
|
|
36
42
|
# @param namespace [String]
|
|
37
43
|
#
|
|
44
|
+
# @param dest_encryption [Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default] (Optional) The encryption configuration for the destination namespace.
|
|
45
|
+
#
|
|
38
46
|
# @param source_api_key [String] (Optional) An API key for the organization containing the source namespace
|
|
39
47
|
#
|
|
40
48
|
# @param source_region [String] (Optional) The region of the source namespace.
|
|
@@ -19,6 +19,14 @@ module Turbopuffer
|
|
|
19
19
|
# @return [Hash{Symbol=>Object}, nil]
|
|
20
20
|
optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
21
21
|
|
|
22
|
+
# @!attribute compute_attributes
|
|
23
|
+
# Computes additional values on documents returned by a query. Each key is the
|
|
24
|
+
# name of the computed attribute; each value is an expression describing how to
|
|
25
|
+
# compute it.
|
|
26
|
+
#
|
|
27
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
28
|
+
optional :compute_attributes, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
29
|
+
|
|
22
30
|
# @!attribute consistency
|
|
23
31
|
# The consistency level for a query.
|
|
24
32
|
#
|
|
@@ -82,7 +90,7 @@ module Turbopuffer
|
|
|
82
90
|
# @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
|
|
83
91
|
optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
|
|
84
92
|
|
|
85
|
-
# @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
93
|
+
# @!method initialize(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
86
94
|
# Some parameter documentations has been truncated, see
|
|
87
95
|
# {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
|
|
88
96
|
#
|
|
@@ -90,6 +98,8 @@ module Turbopuffer
|
|
|
90
98
|
#
|
|
91
99
|
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
|
92
100
|
#
|
|
101
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Computes additional values on documents returned by a query. Each key is the nam
|
|
102
|
+
#
|
|
93
103
|
# @param consistency [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency] The consistency level for a query.
|
|
94
104
|
#
|
|
95
105
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
@@ -52,7 +52,16 @@ module Turbopuffer
|
|
|
52
52
|
# @return [Turbopuffer::Models::NamespaceMetadata::Pinning, nil]
|
|
53
53
|
optional :pinning, -> { Turbopuffer::NamespaceMetadata::Pinning }
|
|
54
54
|
|
|
55
|
-
# @!
|
|
55
|
+
# @!attribute sharding
|
|
56
|
+
# Configuration for namespace sharding, which partitions a namespace's documents
|
|
57
|
+
# across multiple internal shards to scale indexing and query throughput beyond a
|
|
58
|
+
# single machine. Sharding can only be configured on a namespace's inaugural
|
|
59
|
+
# write, and cannot be added to or changed on an existing namespace.
|
|
60
|
+
#
|
|
61
|
+
# @return [Turbopuffer::Models::ShardingConfig, nil]
|
|
62
|
+
optional :sharding, -> { Turbopuffer::ShardingConfig }
|
|
63
|
+
|
|
64
|
+
# @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, encryption:, index:, schema:, updated_at:, pinning: nil, sharding: nil)
|
|
56
65
|
# Some parameter documentations has been truncated, see
|
|
57
66
|
# {Turbopuffer::Models::NamespaceMetadata} for more details.
|
|
58
67
|
#
|
|
@@ -73,6 +82,8 @@ module Turbopuffer
|
|
|
73
82
|
# @param updated_at [Time] The timestamp when the namespace was last modified by a write operation.
|
|
74
83
|
#
|
|
75
84
|
# @param pinning [Turbopuffer::Models::NamespaceMetadata::Pinning] Configuration for namespace pinning, along with the current status of the pinned
|
|
85
|
+
#
|
|
86
|
+
# @param sharding [Turbopuffer::Models::ShardingConfig] Configuration for namespace sharding, which partitions a namespace's documents a
|
|
76
87
|
|
|
77
88
|
# @see Turbopuffer::Models::NamespaceMetadata#index
|
|
78
89
|
module Index
|
|
@@ -57,6 +57,14 @@ module Turbopuffer
|
|
|
57
57
|
# @return [Hash{Symbol=>Object}, nil]
|
|
58
58
|
optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
59
59
|
|
|
60
|
+
# @!attribute compute_attributes
|
|
61
|
+
# Computes additional values on documents returned by a query. Each key is the
|
|
62
|
+
# name of the computed attribute; each value is an expression describing how to
|
|
63
|
+
# compute it.
|
|
64
|
+
#
|
|
65
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
66
|
+
optional :compute_attributes, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
67
|
+
|
|
60
68
|
# @!attribute distance_metric
|
|
61
69
|
# A function used to calculate vector similarity.
|
|
62
70
|
#
|
|
@@ -108,7 +116,7 @@ module Turbopuffer
|
|
|
108
116
|
# @return [Integer, nil]
|
|
109
117
|
optional :top_k, Integer
|
|
110
118
|
|
|
111
|
-
# @!method initialize(aggregate_by: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil)
|
|
119
|
+
# @!method initialize(aggregate_by: nil, compute_attributes: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil)
|
|
112
120
|
# Some parameter documentations has been truncated, see
|
|
113
121
|
# {Turbopuffer::Models::NamespaceMultiQueryParams::Query} for more details.
|
|
114
122
|
#
|
|
@@ -116,6 +124,8 @@ module Turbopuffer
|
|
|
116
124
|
#
|
|
117
125
|
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
|
118
126
|
#
|
|
127
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Computes additional values on documents returned by a query. Each key is the nam
|
|
128
|
+
#
|
|
119
129
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
120
130
|
#
|
|
121
131
|
# @param exclude_attributes [Array<String>] List of attribute names to exclude from the response. All other attributes will
|
|
@@ -19,6 +19,14 @@ module Turbopuffer
|
|
|
19
19
|
# @return [Hash{Symbol=>Object}, nil]
|
|
20
20
|
optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
21
21
|
|
|
22
|
+
# @!attribute compute_attributes
|
|
23
|
+
# Computes additional values on documents returned by a query. Each key is the
|
|
24
|
+
# name of the computed attribute; each value is an expression describing how to
|
|
25
|
+
# compute it.
|
|
26
|
+
#
|
|
27
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
28
|
+
optional :compute_attributes, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
29
|
+
|
|
22
30
|
# @!attribute consistency
|
|
23
31
|
# The consistency level for a query.
|
|
24
32
|
#
|
|
@@ -82,7 +90,7 @@ module Turbopuffer
|
|
|
82
90
|
# @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
|
|
83
91
|
optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
|
|
84
92
|
|
|
85
|
-
# @!method initialize(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
93
|
+
# @!method initialize(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
86
94
|
# Some parameter documentations has been truncated, see
|
|
87
95
|
# {Turbopuffer::Models::NamespaceQueryParams} for more details.
|
|
88
96
|
#
|
|
@@ -90,6 +98,8 @@ module Turbopuffer
|
|
|
90
98
|
#
|
|
91
99
|
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
|
92
100
|
#
|
|
101
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Computes additional values on documents returned by a query. Each key is the nam
|
|
102
|
+
#
|
|
93
103
|
# @param consistency [Turbopuffer::Models::NamespaceQueryParams::Consistency] The consistency level for a query.
|
|
94
104
|
#
|
|
95
105
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
@@ -111,6 +111,15 @@ module Turbopuffer
|
|
|
111
111
|
# @return [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}, nil]
|
|
112
112
|
optional :schema, -> { Turbopuffer::Internal::Type::HashOf[union: Turbopuffer::AttributeSchema] }
|
|
113
113
|
|
|
114
|
+
# @!attribute sharding
|
|
115
|
+
# Configuration for namespace sharding, which partitions a namespace's documents
|
|
116
|
+
# across multiple internal shards to scale indexing and query throughput beyond a
|
|
117
|
+
# single machine. Sharding can only be configured on a namespace's inaugural
|
|
118
|
+
# write, and cannot be added to or changed on an existing namespace.
|
|
119
|
+
#
|
|
120
|
+
# @return [Turbopuffer::Models::ShardingConfig, nil]
|
|
121
|
+
optional :sharding, -> { Turbopuffer::ShardingConfig }
|
|
122
|
+
|
|
114
123
|
# @!attribute upsert_columns
|
|
115
124
|
# A list of documents in columnar format. Each key is a column name, mapped to an
|
|
116
125
|
# array of values for that column.
|
|
@@ -130,7 +139,7 @@ module Turbopuffer
|
|
|
130
139
|
# @return [Array<Turbopuffer::Models::Row>, nil]
|
|
131
140
|
optional :upsert_rows, -> { Turbopuffer::Internal::Type::ArrayOf[Turbopuffer::Row] }
|
|
132
141
|
|
|
133
|
-
# @!method initialize(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
142
|
+
# @!method initialize(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
134
143
|
# Some parameter documentations has been truncated, see
|
|
135
144
|
# {Turbopuffer::Models::NamespaceWriteParams} for more details.
|
|
136
145
|
#
|
|
@@ -168,6 +177,8 @@ module Turbopuffer
|
|
|
168
177
|
#
|
|
169
178
|
# @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] The schema of the attributes attached to the documents.
|
|
170
179
|
#
|
|
180
|
+
# @param sharding [Turbopuffer::Models::ShardingConfig] Configuration for namespace sharding, which partitions a namespace's documents a
|
|
181
|
+
#
|
|
171
182
|
# @param upsert_columns [Turbopuffer::Models::Columns] A list of documents in columnar format. Each key is a column name, mapped to an
|
|
172
183
|
#
|
|
173
184
|
# @param upsert_condition [Object] A condition evaluated against the current value of each document targeted by an
|
|
@@ -9,10 +9,23 @@ module Turbopuffer
|
|
|
9
9
|
# @return [Integer, nil]
|
|
10
10
|
optional :rank_constant, Integer
|
|
11
11
|
|
|
12
|
-
# @!
|
|
12
|
+
# @!attribute weights
|
|
13
|
+
# A positive weight for each subquery, in the same order as `queries`. The number
|
|
14
|
+
# of weights must match the number of subqueries. When omitted, every subquery has
|
|
15
|
+
# a weight of `1`.
|
|
16
|
+
#
|
|
17
|
+
# @return [Array<Float>, nil]
|
|
18
|
+
optional :weights, Turbopuffer::Internal::Type::ArrayOf[Float]
|
|
19
|
+
|
|
20
|
+
# @!method initialize(rank_constant: nil, weights: nil)
|
|
21
|
+
# Some parameter documentations has been truncated, see
|
|
22
|
+
# {Turbopuffer::Models::RrfParams} for more details.
|
|
23
|
+
#
|
|
13
24
|
# Configuration options for RRF.
|
|
14
25
|
#
|
|
15
26
|
# @param rank_constant [Integer] RRF rank constant (`k`). Must be greater than zero. Defaults to `60`.
|
|
27
|
+
#
|
|
28
|
+
# @param weights [Array<Float>] A positive weight for each subquery, in the same order as `queries`. The number
|
|
16
29
|
end
|
|
17
30
|
end
|
|
18
31
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
class ShardingConfig < Turbopuffer::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute num_shards
|
|
7
|
+
# The number of shards to partition the namespace into.
|
|
8
|
+
#
|
|
9
|
+
# @return [Integer]
|
|
10
|
+
required :num_shards, Integer
|
|
11
|
+
|
|
12
|
+
# @!method initialize(num_shards:)
|
|
13
|
+
# Configuration for namespace sharding, which partitions a namespace's documents
|
|
14
|
+
# across multiple internal shards to scale indexing and query throughput beyond a
|
|
15
|
+
# single machine. Sharding can only be configured on a namespace's inaugural
|
|
16
|
+
# write, and cannot be added to or changed on an existing namespace.
|
|
17
|
+
#
|
|
18
|
+
# @param num_shards [Integer] The number of shards to partition the namespace into.
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/turbopuffer/models.rb
CHANGED
|
@@ -82,6 +82,12 @@ module Turbopuffer
|
|
|
82
82
|
|
|
83
83
|
FuzzyParams = Turbopuffer::Models::FuzzyParams
|
|
84
84
|
|
|
85
|
+
HighlightConfigParams = Turbopuffer::Models::HighlightConfigParams
|
|
86
|
+
|
|
87
|
+
HighlightFragmentBy = Turbopuffer::Models::HighlightFragmentBy
|
|
88
|
+
|
|
89
|
+
HighlightOffsetUnits = Turbopuffer::Models::HighlightOffsetUnits
|
|
90
|
+
|
|
85
91
|
ID = Turbopuffer::Models::ID
|
|
86
92
|
|
|
87
93
|
IncludeAttributes = Turbopuffer::Models::IncludeAttributes
|
|
@@ -134,6 +140,8 @@ module Turbopuffer
|
|
|
134
140
|
|
|
135
141
|
SaturateParams = Turbopuffer::Models::SaturateParams
|
|
136
142
|
|
|
143
|
+
ShardingConfig = Turbopuffer::Models::ShardingConfig
|
|
144
|
+
|
|
137
145
|
SparseDistanceMetric = Turbopuffer::Models::SparseDistanceMetric
|
|
138
146
|
|
|
139
147
|
Tokenizer = Turbopuffer::Models::Tokenizer
|
|
@@ -36,12 +36,14 @@ module Turbopuffer
|
|
|
36
36
|
#
|
|
37
37
|
# Copy all documents from another namespace into this one.
|
|
38
38
|
#
|
|
39
|
-
# @overload copy_from(source_namespace:, namespace: nil, source_api_key: nil, source_region: nil, request_options: {})
|
|
39
|
+
# @overload copy_from(source_namespace:, namespace: nil, dest_encryption: nil, source_api_key: nil, source_region: nil, request_options: {})
|
|
40
40
|
#
|
|
41
41
|
# @param source_namespace [String] Body param: The namespace to copy documents from.
|
|
42
42
|
#
|
|
43
43
|
# @param namespace [String] Path param: The name of the namespace.
|
|
44
44
|
#
|
|
45
|
+
# @param dest_encryption [Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default] Body param: (Optional) The encryption configuration for the destination namespac
|
|
46
|
+
#
|
|
45
47
|
# @param source_api_key [String] Body param: (Optional) An API key for the organization containing the source nam
|
|
46
48
|
#
|
|
47
49
|
# @param source_region [String] Body param: (Optional) The region of the source namespace.
|
|
@@ -96,12 +98,14 @@ module Turbopuffer
|
|
|
96
98
|
#
|
|
97
99
|
# Explain a query plan.
|
|
98
100
|
#
|
|
99
|
-
# @overload explain_query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
101
|
+
# @overload explain_query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
100
102
|
#
|
|
101
103
|
# @param namespace [String] Path param: The name of the namespace.
|
|
102
104
|
#
|
|
103
105
|
# @param aggregate_by [Hash{Symbol=>Object}] Body param: Aggregations to compute over all documents in the namespace that mat
|
|
104
106
|
#
|
|
107
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Body param: Computes additional values on documents returned by a query. Each ke
|
|
108
|
+
#
|
|
105
109
|
# @param consistency [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency] Body param: The consistency level for a query.
|
|
106
110
|
#
|
|
107
111
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] Body param: A function used to calculate vector similarity.
|
|
@@ -234,12 +238,14 @@ module Turbopuffer
|
|
|
234
238
|
#
|
|
235
239
|
# Query, filter, full-text search and vector search documents.
|
|
236
240
|
#
|
|
237
|
-
# @overload query(namespace: nil, aggregate_by: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
241
|
+
# @overload query(namespace: nil, aggregate_by: nil, compute_attributes: nil, consistency: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
238
242
|
#
|
|
239
243
|
# @param namespace [String] Path param: The name of the namespace.
|
|
240
244
|
#
|
|
241
245
|
# @param aggregate_by [Hash{Symbol=>Object}] Body param: Aggregations to compute over all documents in the namespace that mat
|
|
242
246
|
#
|
|
247
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Body param: Computes additional values on documents returned by a query. Each ke
|
|
248
|
+
#
|
|
243
249
|
# @param consistency [Turbopuffer::Models::NamespaceQueryParams::Consistency] Body param: The consistency level for a query.
|
|
244
250
|
#
|
|
245
251
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] Body param: A function used to calculate vector similarity.
|
|
@@ -408,7 +414,7 @@ module Turbopuffer
|
|
|
408
414
|
#
|
|
409
415
|
# Create, update, or delete documents.
|
|
410
416
|
#
|
|
411
|
-
# @overload write(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
417
|
+
# @overload write(namespace: nil, branch_from_namespace: nil, copy_from_namespace: nil, delete_by_filter: nil, delete_by_filter_allow_partial: nil, delete_condition: nil, deletes: nil, disable_backpressure: nil, distance_metric: nil, encryption: nil, patch_by_filter: nil, patch_by_filter_allow_partial: nil, patch_columns: nil, patch_condition: nil, patch_rows: nil, return_affected_ids: nil, schema: nil, sharding: nil, upsert_columns: nil, upsert_condition: nil, upsert_rows: nil, request_options: {})
|
|
412
418
|
#
|
|
413
419
|
# @param namespace [String] Path param: The name of the namespace.
|
|
414
420
|
#
|
|
@@ -444,6 +450,8 @@ module Turbopuffer
|
|
|
444
450
|
#
|
|
445
451
|
# @param schema [Hash{Symbol=>String, Turbopuffer::Models::AttributeSchemaConfig}] Body param: The schema of the attributes attached to the documents.
|
|
446
452
|
#
|
|
453
|
+
# @param sharding [Turbopuffer::Models::ShardingConfig] Body param: Configuration for namespace sharding, which partitions a namespace's
|
|
454
|
+
#
|
|
447
455
|
# @param upsert_columns [Turbopuffer::Models::Columns] Body param: A list of documents in columnar format. Each key is a column name, m
|
|
448
456
|
#
|
|
449
457
|
# @param upsert_condition [Object] Body param: A condition evaluated against the current value of each document tar
|
data/lib/turbopuffer/version.rb
CHANGED
data/lib/turbopuffer.rb
CHANGED
|
@@ -77,6 +77,9 @@ require_relative "turbopuffer/models/full_text_search"
|
|
|
77
77
|
require_relative "turbopuffer/models/full_text_search_config"
|
|
78
78
|
require_relative "turbopuffer/models/fuzzy_max_edit_distance"
|
|
79
79
|
require_relative "turbopuffer/models/fuzzy_params"
|
|
80
|
+
require_relative "turbopuffer/models/highlight_config_params"
|
|
81
|
+
require_relative "turbopuffer/models/highlight_fragment_by"
|
|
82
|
+
require_relative "turbopuffer/models/highlight_offset_units"
|
|
80
83
|
require_relative "turbopuffer/models/id"
|
|
81
84
|
require_relative "turbopuffer/models/include_attributes"
|
|
82
85
|
require_relative "turbopuffer/models/language"
|
|
@@ -112,6 +115,7 @@ require_relative "turbopuffer/models/query_performance"
|
|
|
112
115
|
require_relative "turbopuffer/models/row"
|
|
113
116
|
require_relative "turbopuffer/models/rrf_params"
|
|
114
117
|
require_relative "turbopuffer/models/saturate_params"
|
|
118
|
+
require_relative "turbopuffer/models/sharding_config"
|
|
115
119
|
require_relative "turbopuffer/models/sparse_distance_metric"
|
|
116
120
|
require_relative "turbopuffer/models/tokenizer"
|
|
117
121
|
require_relative "turbopuffer/models/vector"
|
|
@@ -210,21 +210,38 @@ module Turbopuffer
|
|
|
210
210
|
end
|
|
211
211
|
attr_writer :distance_metric
|
|
212
212
|
|
|
213
|
+
# Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
|
|
214
|
+
# vector array attributes, and is required to enable an ANN index on such
|
|
215
|
+
# attributes. Defaults to `false`.
|
|
216
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
217
|
+
attr_reader :late_interaction
|
|
218
|
+
|
|
219
|
+
sig { params(late_interaction: T::Boolean).void }
|
|
220
|
+
attr_writer :late_interaction
|
|
221
|
+
|
|
213
222
|
# Configuration options for ANN (Approximate Nearest Neighbor) indexing.
|
|
214
223
|
sig do
|
|
215
224
|
params(
|
|
216
|
-
distance_metric: Turbopuffer::DistanceMetric::OrSymbol
|
|
225
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
|
226
|
+
late_interaction: T::Boolean
|
|
217
227
|
).returns(T.attached_class)
|
|
218
228
|
end
|
|
219
229
|
def self.new(
|
|
220
230
|
# A function used to calculate vector similarity.
|
|
221
|
-
distance_metric: nil
|
|
231
|
+
distance_metric: nil,
|
|
232
|
+
# Opt in to late-interaction (MUVERA) indexing. Only valid on fixed-dim `[][N]f32`
|
|
233
|
+
# vector array attributes, and is required to enable an ANN index on such
|
|
234
|
+
# attributes. Defaults to `false`.
|
|
235
|
+
late_interaction: nil
|
|
222
236
|
)
|
|
223
237
|
end
|
|
224
238
|
|
|
225
239
|
sig do
|
|
226
240
|
override.returns(
|
|
227
|
-
{
|
|
241
|
+
{
|
|
242
|
+
distance_metric: Turbopuffer::DistanceMetric::OrSymbol,
|
|
243
|
+
late_interaction: T::Boolean
|
|
244
|
+
}
|
|
228
245
|
)
|
|
229
246
|
end
|
|
230
247
|
def to_hash
|