turbopuffer 2.3.0 → 2.5.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 +40 -0
- data/README.md +1 -10
- data/lib/turbopuffer/client.rb +2 -2
- data/lib/turbopuffer/internal/type/union.rb +17 -7
- data/lib/turbopuffer/models/attribute_schema_config.rb +14 -1
- data/lib/turbopuffer/models/copy_from_namespace_operation.rb +84 -0
- data/lib/turbopuffer/models/copy_from_namespace_operation_result.rb +37 -0
- 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_explain_query_params.rb +20 -1
- data/lib/turbopuffer/models/namespace_metadata.rb +32 -2
- data/lib/turbopuffer/models/namespace_metadata_patch.rb +10 -1
- data/lib/turbopuffer/models/namespace_multi_query_params.rb +55 -2
- data/lib/turbopuffer/models/namespace_poll_copy_from_params.rb +26 -0
- data/lib/turbopuffer/models/namespace_query_params.rb +20 -1
- data/lib/turbopuffer/models/namespace_start_copy_from_params.rb +53 -0
- data/lib/turbopuffer/models/namespace_start_copy_from_response.rb +17 -0
- data/lib/turbopuffer/models/namespace_write_params.rb +12 -1
- data/lib/turbopuffer/models/operation_error.rb +46 -0
- data/lib/turbopuffer/models/rerank_limit.rb +18 -0
- data/lib/turbopuffer/models/rrf_params.rb +14 -1
- data/lib/turbopuffer/models/sharding_config.rb +21 -0
- data/lib/turbopuffer/models/write_result.rb +112 -0
- data/lib/turbopuffer/models.rb +22 -0
- data/lib/turbopuffer/resources/namespaces.rb +87 -5
- data/lib/turbopuffer/version.rb +1 -1
- data/lib/turbopuffer.rb +12 -0
- data/rbi/turbopuffer/client.rbi +2 -2
- data/rbi/turbopuffer/models/attribute_schema_config.rbi +20 -3
- data/rbi/turbopuffer/models/copy_from_namespace_operation.rbi +133 -0
- data/rbi/turbopuffer/models/copy_from_namespace_operation_result.rbi +85 -0
- 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_explain_query_params.rbi +28 -0
- data/rbi/turbopuffer/models/namespace_metadata.rbi +50 -4
- data/rbi/turbopuffer/models/namespace_metadata_patch.rbi +18 -3
- data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +69 -0
- data/rbi/turbopuffer/models/namespace_poll_copy_from_params.rbi +49 -0
- data/rbi/turbopuffer/models/namespace_query_params.rbi +28 -0
- data/rbi/turbopuffer/models/namespace_start_copy_from_params.rbi +113 -0
- data/rbi/turbopuffer/models/namespace_start_copy_from_response.rbi +30 -0
- data/rbi/turbopuffer/models/namespace_write_params.rbi +17 -0
- data/rbi/turbopuffer/models/operation_error.rbi +77 -0
- data/rbi/turbopuffer/models/rerank_limit.rbi +28 -0
- data/rbi/turbopuffer/models/rrf_params.rbi +22 -3
- data/rbi/turbopuffer/models/sharding_config.rbi +31 -0
- data/rbi/turbopuffer/models/write_result.rbi +159 -0
- data/rbi/turbopuffer/models.rbi +24 -0
- data/rbi/turbopuffer/resources/namespaces.rbi +87 -0
- data/sig/turbopuffer/models/attribute_schema_config.rbs +12 -3
- data/sig/turbopuffer/models/copy_from_namespace_operation.rbs +65 -0
- data/sig/turbopuffer/models/copy_from_namespace_operation_result.rbs +33 -0
- 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_explain_query_params.rbs +14 -0
- data/sig/turbopuffer/models/namespace_metadata.rbs +29 -4
- data/sig/turbopuffer/models/namespace_metadata_patch.rbs +12 -3
- data/sig/turbopuffer/models/namespace_multi_query_params.rbs +38 -0
- data/sig/turbopuffer/models/namespace_poll_copy_from_params.rbs +30 -0
- data/sig/turbopuffer/models/namespace_query_params.rbs +14 -0
- data/sig/turbopuffer/models/namespace_start_copy_from_params.rbs +56 -0
- data/sig/turbopuffer/models/namespace_start_copy_from_response.rbs +13 -0
- data/sig/turbopuffer/models/namespace_write_params.rbs +9 -0
- data/sig/turbopuffer/models/operation_error.rbs +34 -0
- data/sig/turbopuffer/models/rerank_limit.rbs +13 -0
- data/sig/turbopuffer/models/rrf_params.rbs +10 -3
- data/sig/turbopuffer/models/sharding_config.rbs +13 -0
- data/sig/turbopuffer/models/write_result.rbs +99 -0
- data/sig/turbopuffer/models.rbs +22 -0
- data/sig/turbopuffer/resources/namespaces.rbs +23 -0
- metadata +38 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7a74005340bd71314cefec78857e87f61242c5e99ca0619718932862dfb9b3e
|
|
4
|
+
data.tar.gz: 90568747fb99e6f0c3e07e135600cd49e48e806023059f27f0f270bb3f20ca20
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e01efec060630c4a1b3840c93dc93148fd8724ffe326b7b697679a6d2a51eeecea9692ece6be917b3d42d7ed85ed1a958db57134f215b4290ab63f0c33521232
|
|
7
|
+
data.tar.gz: 9ce535511cfc814424db7cf0c6567b35724ddb1c75550224866a805040220b2daf28c9b0dfa686153f2a6e8a41c056066c29d0952a805594e7bda8cfe356351b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.0 (2026-09-18)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.4.0...v2.5.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.4.0...v2.5.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Add `read_only` namespace field ([8dfb1f7](https://github.com/turbopuffer/turbopuffer-ruby/commit/8dfb1f77bf0f2ad5eb1c238a0c4b3df49549b9fd))
|
|
10
|
+
* **api:** Merge remote-tracking branch 'origin/preview/benesch/named-rerank-limit-schema' ([917c0b7](https://github.com/turbopuffer/turbopuffer-ruby/commit/917c0b700820ef1d68eb92c485d02e1013fe4479))
|
|
11
|
+
* Apply limit on rerank_by when provided ([fbd70cb](https://github.com/turbopuffer/turbopuffer-ruby/commit/fbd70cbaeb31bae86f197975d2bdd40669620cf1))
|
|
12
|
+
* engine,openapi: async copy_from_namespace endpoints ([5af8916](https://github.com/turbopuffer/turbopuffer-ruby/commit/5af89166d027304ae1869e691bf79cade774c04a))
|
|
13
|
+
* spec: no-op change to Stainless spec ([4e0d0cc](https://github.com/turbopuffer/turbopuffer-ruby/commit/4e0d0ccb819df54524e8b5c3fd3efea8105ddae7))
|
|
14
|
+
* tpuf-engine: Adding pagination through `offset` ([1de87c9](https://github.com/turbopuffer/turbopuffer-ruby/commit/1de87c959126a8737a724c5cd594bd844cc43bf0))
|
|
15
|
+
* tpuf-engine: expose billed_replicas in pinning metadata ([3f414fc](https://github.com/turbopuffer/turbopuffer-ruby/commit/3f414fcf1df33d8f41615755c5474f8fcd6713b2))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* wrap start copy request bodies ([#70](https://github.com/turbopuffer/turbopuffer-ruby/issues/70)) ([4a44435](https://github.com/turbopuffer/turbopuffer-ruby/commit/4a444351b3a1dc68f0dcba86fe15dcac03d3ae88))
|
|
21
|
+
|
|
22
|
+
## 2.4.0 (2026-07-30)
|
|
23
|
+
|
|
24
|
+
Full Changelog: [v2.3.0...v2.4.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.3.0...v2.4.0)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* openapi: add RRF `weights` parameter ([621628b](https://github.com/turbopuffer/turbopuffer-ruby/commit/621628bc8d9ed54a0ab5006c20ba5f4ae03e966e))
|
|
29
|
+
* spec: add sharding config to the openapi spec ([2228a03](https://github.com/turbopuffer/turbopuffer-ruby/commit/2228a031201ad1b3d20ae1c77d029d665c67e428))
|
|
30
|
+
* spec: expose computed attributes ([597fdde](https://github.com/turbopuffer/turbopuffer-ruby/commit/597fdde888efd50b9873b056ab0c12fab5a9e600))
|
|
31
|
+
* spec: hide HighlightConfig.rank_fragments_by's RankBy ref from Stainless ([59c2734](https://github.com/turbopuffer/turbopuffer-ruby/commit/59c273482fcfccce1fc8f4d8b8d3ae13c0fbbcdc))
|
|
32
|
+
* spec: make compute_attributes value x-stainless-any ([c170466](https://github.com/turbopuffer/turbopuffer-ruby/commit/c17046653f2533e00e9129d4e807a5ab2c3b1cd6))
|
|
33
|
+
* spec: rename HighlightConfig -> HighlightConfigParams ([36413c3](https://github.com/turbopuffer/turbopuffer-ruby/commit/36413c3bebab413e60ab51ba728437e66edaa7ab))
|
|
34
|
+
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([12b486b](https://github.com/turbopuffer/turbopuffer-ruby/commit/12b486b953bf4521f18eb1187ba20812d30b3cfd))
|
|
35
|
+
* support late_interaction parameter in sdks ([ac90617](https://github.com/turbopuffer/turbopuffer-ruby/commit/ac9061734ae8f47e823c20f381bf925c27634d8e))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Chores
|
|
39
|
+
|
|
40
|
+
* **internal:** bound formatter parallelism to CPU count ([a56e5af](https://github.com/turbopuffer/turbopuffer-ruby/commit/a56e5af20b69bd39b12fbf2e9db2cd6d9b1b1ee8))
|
|
41
|
+
* remove unused MCP package ([2b81b9a](https://github.com/turbopuffer/turbopuffer-ruby/commit/2b81b9ae116370e14cf1213e056b147277e6cca3))
|
|
42
|
+
|
|
3
43
|
## 2.3.0 (2026-06-16)
|
|
4
44
|
|
|
5
45
|
Full Changelog: [v2.2.0...v2.3.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.2.0...v2.3.0)
|
data/README.md
CHANGED
|
@@ -4,15 +4,6 @@ The turbopuffer Ruby library provides convenient access to the [turbopuffer HTTP
|
|
|
4
4
|
|
|
5
5
|
It is generated with [Stainless](https://www.stainless.com/).
|
|
6
6
|
|
|
7
|
-
## MCP Server
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
[](https://cursor.com/en-US/install-mcp?name=%40turbopuffer%2Fturbopuffer-mcp&config=eyJuYW1lIjoiQHR1cmJvcHVmZmVyL3R1cmJvcHVmZmVyLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL3R1cmJvcHVmZmVyLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtdHVyYm9wdWZmZXItYXBpLWtleSI6InRwdWZfQTEuLi4ifX0)
|
|
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)
|
|
13
|
-
|
|
14
|
-
> Note: You may need to set environment variables in your MCP client.
|
|
15
|
-
|
|
16
7
|
## Documentation
|
|
17
8
|
|
|
18
9
|
Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/turbopuffer).
|
|
@@ -26,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
26
17
|
<!-- x-release-please-start-version -->
|
|
27
18
|
|
|
28
19
|
```ruby
|
|
29
|
-
gem "turbopuffer", "~> 2.
|
|
20
|
+
gem "turbopuffer", "~> 2.5.0"
|
|
30
21
|
```
|
|
31
22
|
|
|
32
23
|
<!-- x-release-please-end -->
|
data/lib/turbopuffer/client.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Turbopuffer
|
|
|
15
15
|
# Default max retry delay in seconds.
|
|
16
16
|
DEFAULT_MAX_RETRY_DELAY = 8.0
|
|
17
17
|
|
|
18
|
-
# API key used for authentication
|
|
18
|
+
# API key used for authentication.
|
|
19
19
|
# @return [String]
|
|
20
20
|
attr_reader :api_key
|
|
21
21
|
|
|
@@ -74,7 +74,7 @@ module Turbopuffer
|
|
|
74
74
|
|
|
75
75
|
# Creates and returns a new client for interacting with the API.
|
|
76
76
|
#
|
|
77
|
-
# @param api_key [String, nil] API key used for authentication Defaults to `ENV["TURBOPUFFER_API_KEY"]`
|
|
77
|
+
# @param api_key [String, nil] API key used for authentication. Defaults to `ENV["TURBOPUFFER_API_KEY"]`
|
|
78
78
|
#
|
|
79
79
|
# @param region [String, nil] The turbopuffer region to use. Defaults to `ENV["TURBOPUFFER_REGION"]`
|
|
80
80
|
#
|
|
@@ -6,14 +6,24 @@ module Turbopuffer
|
|
|
6
6
|
# @api private
|
|
7
7
|
#
|
|
8
8
|
# @example
|
|
9
|
-
# # `
|
|
10
|
-
# case
|
|
11
|
-
# when
|
|
12
|
-
#
|
|
13
|
-
# when Turbopuffer::
|
|
14
|
-
# puts(
|
|
9
|
+
# # `copy_from_namespace_operation` is a `Turbopuffer::CopyFromNamespaceOperation`
|
|
10
|
+
# case copy_from_namespace_operation
|
|
11
|
+
# when Turbopuffer::CopyFromNamespaceOperation::Running
|
|
12
|
+
# puts(copy_from_namespace_operation.start_time)
|
|
13
|
+
# when Turbopuffer::CopyFromNamespaceOperation::Finished
|
|
14
|
+
# puts(copy_from_namespace_operation.finish_time)
|
|
15
15
|
# else
|
|
16
|
-
# puts(
|
|
16
|
+
# puts(copy_from_namespace_operation)
|
|
17
|
+
# end
|
|
18
|
+
#
|
|
19
|
+
# @example
|
|
20
|
+
# case copy_from_namespace_operation
|
|
21
|
+
# in {status: :running, start_time: start_time, progress: progress}
|
|
22
|
+
# puts(start_time)
|
|
23
|
+
# in {status: :finished, finish_time: finish_time, result: result, start_time: start_time}
|
|
24
|
+
# puts(finish_time)
|
|
25
|
+
# else
|
|
26
|
+
# puts(copy_from_namespace_operation)
|
|
17
27
|
# end
|
|
18
28
|
module Union
|
|
19
29
|
include Turbopuffer::Internal::Type::Converter
|
|
@@ -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,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
# The current status of a copy operation.
|
|
6
|
+
#
|
|
7
|
+
# @see Turbopuffer::Resources::Namespaces#poll_copy_from
|
|
8
|
+
module CopyFromNamespaceOperation
|
|
9
|
+
extend Turbopuffer::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
discriminator :status
|
|
12
|
+
|
|
13
|
+
variant :running, -> { Turbopuffer::CopyFromNamespaceOperation::Running }
|
|
14
|
+
|
|
15
|
+
variant :finished, -> { Turbopuffer::CopyFromNamespaceOperation::Finished }
|
|
16
|
+
|
|
17
|
+
class Running < Turbopuffer::Internal::Type::BaseModel
|
|
18
|
+
# @!attribute start_time
|
|
19
|
+
# The time at which the operation started.
|
|
20
|
+
#
|
|
21
|
+
# @return [Time]
|
|
22
|
+
required :start_time, Time
|
|
23
|
+
|
|
24
|
+
# @!attribute status
|
|
25
|
+
#
|
|
26
|
+
# @return [Symbol, :running]
|
|
27
|
+
required :status, const: :running
|
|
28
|
+
|
|
29
|
+
# @!attribute progress
|
|
30
|
+
# A freeform description of the operation's progress. May be absent, and its
|
|
31
|
+
# format may change.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :progress, String
|
|
35
|
+
|
|
36
|
+
# @!method initialize(start_time:, progress: nil, status: :running)
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Turbopuffer::Models::CopyFromNamespaceOperation::Running} for more details.
|
|
39
|
+
#
|
|
40
|
+
# @param start_time [Time] The time at which the operation started.
|
|
41
|
+
#
|
|
42
|
+
# @param progress [String] A freeform description of the operation's progress. May be absent, and its forma
|
|
43
|
+
#
|
|
44
|
+
# @param status [Symbol, :running]
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class Finished < Turbopuffer::Internal::Type::BaseModel
|
|
48
|
+
# @!attribute finish_time
|
|
49
|
+
# The time at which the operation finished.
|
|
50
|
+
#
|
|
51
|
+
# @return [Time]
|
|
52
|
+
required :finish_time, Time
|
|
53
|
+
|
|
54
|
+
# @!attribute result
|
|
55
|
+
#
|
|
56
|
+
# @return [Turbopuffer::Models::CopyFromNamespaceOperationResult::Success, Turbopuffer::Models::CopyFromNamespaceOperationResult::Error]
|
|
57
|
+
required :result, union: -> { Turbopuffer::CopyFromNamespaceOperationResult }
|
|
58
|
+
|
|
59
|
+
# @!attribute start_time
|
|
60
|
+
# The time at which the operation started.
|
|
61
|
+
#
|
|
62
|
+
# @return [Time]
|
|
63
|
+
required :start_time, Time
|
|
64
|
+
|
|
65
|
+
# @!attribute status
|
|
66
|
+
#
|
|
67
|
+
# @return [Symbol, :finished]
|
|
68
|
+
required :status, const: :finished
|
|
69
|
+
|
|
70
|
+
# @!method initialize(finish_time:, result:, start_time:, status: :finished)
|
|
71
|
+
# @param finish_time [Time] The time at which the operation finished.
|
|
72
|
+
#
|
|
73
|
+
# @param result [Turbopuffer::Models::CopyFromNamespaceOperationResult::Success, Turbopuffer::Models::CopyFromNamespaceOperationResult::Error]
|
|
74
|
+
#
|
|
75
|
+
# @param start_time [Time] The time at which the operation started.
|
|
76
|
+
#
|
|
77
|
+
# @param status [Symbol, :finished]
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @!method self.variants
|
|
81
|
+
# @return [Array(Turbopuffer::Models::CopyFromNamespaceOperation::Running, Turbopuffer::Models::CopyFromNamespaceOperation::Finished)]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Turbopuffer
|
|
4
|
+
module Models
|
|
5
|
+
module CopyFromNamespaceOperationResult
|
|
6
|
+
extend Turbopuffer::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
variant -> { Turbopuffer::CopyFromNamespaceOperationResult::Success }
|
|
9
|
+
|
|
10
|
+
variant -> { Turbopuffer::CopyFromNamespaceOperationResult::Error }
|
|
11
|
+
|
|
12
|
+
class Success < Turbopuffer::Internal::Type::BaseModel
|
|
13
|
+
# @!attribute success
|
|
14
|
+
# The response to a successful write request.
|
|
15
|
+
#
|
|
16
|
+
# @return [Turbopuffer::Models::WriteResult]
|
|
17
|
+
required :success, -> { Turbopuffer::WriteResult }
|
|
18
|
+
|
|
19
|
+
# @!method initialize(success:)
|
|
20
|
+
# @param success [Turbopuffer::Models::WriteResult] The response to a successful write request.
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class Error < Turbopuffer::Internal::Type::BaseModel
|
|
24
|
+
# @!attribute error
|
|
25
|
+
#
|
|
26
|
+
# @return [Turbopuffer::Models::OperationError]
|
|
27
|
+
required :error, -> { Turbopuffer::OperationError }
|
|
28
|
+
|
|
29
|
+
# @!method initialize(error:)
|
|
30
|
+
# @param error [Turbopuffer::Models::OperationError]
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# @!method self.variants
|
|
34
|
+
# @return [Array(Turbopuffer::Models::CopyFromNamespaceOperationResult::Success, Turbopuffer::Models::CopyFromNamespaceOperationResult::Error)]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -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
|
|
@@ -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
|
#
|
|
@@ -64,6 +72,13 @@ module Turbopuffer
|
|
|
64
72
|
# @return [Integer, Turbopuffer::Models::Limit, nil]
|
|
65
73
|
optional :limit, union: -> { Turbopuffer::NamespaceExplainQueryParams::Limit }
|
|
66
74
|
|
|
75
|
+
# @!attribute offset
|
|
76
|
+
# Number of documents to skip before returning results. Supported only in v2
|
|
77
|
+
# queries with an explicit `rank_by` and `top_k` or `limit`.
|
|
78
|
+
#
|
|
79
|
+
# @return [Integer, nil]
|
|
80
|
+
optional :offset, Integer
|
|
81
|
+
|
|
67
82
|
# @!attribute rank_by
|
|
68
83
|
# How to rank the documents in the namespace.
|
|
69
84
|
#
|
|
@@ -82,7 +97,7 @@ module Turbopuffer
|
|
|
82
97
|
# @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
|
|
83
98
|
optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
|
|
84
99
|
|
|
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: {})
|
|
100
|
+
# @!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, offset: nil, rank_by: nil, top_k: nil, vector_encoding: nil, request_options: {})
|
|
86
101
|
# Some parameter documentations has been truncated, see
|
|
87
102
|
# {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
|
|
88
103
|
#
|
|
@@ -90,6 +105,8 @@ module Turbopuffer
|
|
|
90
105
|
#
|
|
91
106
|
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
|
92
107
|
#
|
|
108
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Computes additional values on documents returned by a query. Each key is the nam
|
|
109
|
+
#
|
|
93
110
|
# @param consistency [Turbopuffer::Models::NamespaceExplainQueryParams::Consistency] The consistency level for a query.
|
|
94
111
|
#
|
|
95
112
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
@@ -104,6 +121,8 @@ module Turbopuffer
|
|
|
104
121
|
#
|
|
105
122
|
# @param limit [Integer, Turbopuffer::Models::Limit] Limits the documents returned by a query.
|
|
106
123
|
#
|
|
124
|
+
# @param offset [Integer] Number of documents to skip before returning results. Supported only in v2 queri
|
|
125
|
+
#
|
|
107
126
|
# @param rank_by [Object] How to rank the documents in the namespace.
|
|
108
127
|
#
|
|
109
128
|
# @param top_k [Integer] The number of results to return.
|
|
@@ -52,7 +52,22 @@ module Turbopuffer
|
|
|
52
52
|
# @return [Turbopuffer::Models::NamespaceMetadata::Pinning, nil]
|
|
53
53
|
optional :pinning, -> { Turbopuffer::NamespaceMetadata::Pinning }
|
|
54
54
|
|
|
55
|
-
# @!
|
|
55
|
+
# @!attribute read_only
|
|
56
|
+
# Whether document and schema writes are rejected. Omitted when `false`.
|
|
57
|
+
#
|
|
58
|
+
# @return [Boolean, nil]
|
|
59
|
+
optional :read_only, Turbopuffer::Internal::Type::Boolean
|
|
60
|
+
|
|
61
|
+
# @!attribute sharding
|
|
62
|
+
# Configuration for namespace sharding, which partitions a namespace's documents
|
|
63
|
+
# across multiple internal shards to scale indexing and query throughput beyond a
|
|
64
|
+
# single machine. Sharding can only be configured on a namespace's inaugural
|
|
65
|
+
# write, and cannot be added to or changed on an existing namespace.
|
|
66
|
+
#
|
|
67
|
+
# @return [Turbopuffer::Models::ShardingConfig, nil]
|
|
68
|
+
optional :sharding, -> { Turbopuffer::ShardingConfig }
|
|
69
|
+
|
|
70
|
+
# @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, encryption:, index:, schema:, updated_at:, pinning: nil, read_only: nil, sharding: nil)
|
|
56
71
|
# Some parameter documentations has been truncated, see
|
|
57
72
|
# {Turbopuffer::Models::NamespaceMetadata} for more details.
|
|
58
73
|
#
|
|
@@ -73,6 +88,10 @@ module Turbopuffer
|
|
|
73
88
|
# @param updated_at [Time] The timestamp when the namespace was last modified by a write operation.
|
|
74
89
|
#
|
|
75
90
|
# @param pinning [Turbopuffer::Models::NamespaceMetadata::Pinning] Configuration for namespace pinning, along with the current status of the pinned
|
|
91
|
+
#
|
|
92
|
+
# @param read_only [Boolean] Whether document and schema writes are rejected. Omitted when `false`.
|
|
93
|
+
#
|
|
94
|
+
# @param sharding [Turbopuffer::Models::ShardingConfig] Configuration for namespace sharding, which partitions a namespace's documents a
|
|
76
95
|
|
|
77
96
|
# @see Turbopuffer::Models::NamespaceMetadata#index
|
|
78
97
|
module Index
|
|
@@ -139,6 +158,15 @@ module Turbopuffer
|
|
|
139
158
|
# @return [Integer]
|
|
140
159
|
required :ready_replicas, Integer
|
|
141
160
|
|
|
161
|
+
# @!attribute replicas
|
|
162
|
+
# The number of running replicas for the namespace. Replicas are billed once
|
|
163
|
+
# running, even before they finish warming their caches and become ready to serve
|
|
164
|
+
# traffic. This count is updated independently and may briefly disagree with the
|
|
165
|
+
# other status fields.
|
|
166
|
+
#
|
|
167
|
+
# @return [Integer]
|
|
168
|
+
required :replicas, Integer
|
|
169
|
+
|
|
142
170
|
# @!attribute updated_at
|
|
143
171
|
# The timestamp of the latest pinning status snapshot.
|
|
144
172
|
#
|
|
@@ -152,7 +180,7 @@ module Turbopuffer
|
|
|
152
180
|
# @return [Float]
|
|
153
181
|
required :utilization, Float
|
|
154
182
|
|
|
155
|
-
# @!method initialize(ready_replicas:, updated_at:, utilization:)
|
|
183
|
+
# @!method initialize(ready_replicas:, replicas:, updated_at:, utilization:)
|
|
156
184
|
# Some parameter documentations has been truncated, see
|
|
157
185
|
# {Turbopuffer::Models::NamespaceMetadata::Pinning::Status} for more details.
|
|
158
186
|
#
|
|
@@ -160,6 +188,8 @@ module Turbopuffer
|
|
|
160
188
|
#
|
|
161
189
|
# @param ready_replicas [Integer] The number of replicas that are warm and serving traffic.
|
|
162
190
|
#
|
|
191
|
+
# @param replicas [Integer] The number of running replicas for the namespace. Replicas are billed once runni
|
|
192
|
+
#
|
|
163
193
|
# @param updated_at [Time] The timestamp of the latest pinning status snapshot.
|
|
164
194
|
#
|
|
165
195
|
# @param utilization [Float] Aggregate utilization for the pinned namespace, reported as a value between 0.0
|
|
@@ -14,13 +14,22 @@ module Turbopuffer
|
|
|
14
14
|
# @return [Boolean, Turbopuffer::Models::PinningConfig, nil]
|
|
15
15
|
optional :pinning, union: -> { Turbopuffer::NamespaceMetadataPatch::Pinning }, nil?: true
|
|
16
16
|
|
|
17
|
-
# @!
|
|
17
|
+
# @!attribute read_only
|
|
18
|
+
# Set to `true` to reject document and schema writes, or `false` to allow them.
|
|
19
|
+
# Writes already in progress may still commit. Metadata updates remain available.
|
|
20
|
+
#
|
|
21
|
+
# @return [Boolean, nil]
|
|
22
|
+
optional :read_only, Turbopuffer::Internal::Type::Boolean
|
|
23
|
+
|
|
24
|
+
# @!method initialize(pinning: nil, read_only: nil)
|
|
18
25
|
# Some parameter documentations has been truncated, see
|
|
19
26
|
# {Turbopuffer::Models::NamespaceMetadataPatch} for more details.
|
|
20
27
|
#
|
|
21
28
|
# Request to update namespace metadata configuration.
|
|
22
29
|
#
|
|
23
30
|
# @param pinning [Boolean, Turbopuffer::Models::PinningConfig, nil] Configuration for namespace pinning.
|
|
31
|
+
#
|
|
32
|
+
# @param read_only [Boolean] Set to `true` to reject document and schema writes, or `false` to allow them. Wr
|
|
24
33
|
|
|
25
34
|
# Configuration for namespace pinning.
|
|
26
35
|
#
|
|
@@ -24,6 +24,19 @@ module Turbopuffer
|
|
|
24
24
|
# @return [Turbopuffer::Models::NamespaceMultiQueryParams::Consistency, nil]
|
|
25
25
|
optional :consistency, -> { Turbopuffer::NamespaceMultiQueryParams::Consistency }
|
|
26
26
|
|
|
27
|
+
# @!attribute limit
|
|
28
|
+
# Limits the total number of reranked documents returned.
|
|
29
|
+
#
|
|
30
|
+
# @return [Integer, Turbopuffer::Models::RerankLimit, nil]
|
|
31
|
+
optional :limit, union: -> { Turbopuffer::NamespaceMultiQueryParams::Limit }
|
|
32
|
+
|
|
33
|
+
# @!attribute offset
|
|
34
|
+
# Number of reranked documents to skip before returning results. Requires
|
|
35
|
+
# `rerank_by` and `limit`.
|
|
36
|
+
#
|
|
37
|
+
# @return [Integer, nil]
|
|
38
|
+
optional :offset, Integer
|
|
39
|
+
|
|
27
40
|
# @!attribute rerank_by
|
|
28
41
|
# How to combine the rows returned by each sub-query into a single ranked list.
|
|
29
42
|
#
|
|
@@ -36,13 +49,21 @@ module Turbopuffer
|
|
|
36
49
|
# @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
|
|
37
50
|
optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
|
|
38
51
|
|
|
39
|
-
# @!method initialize(queries:, namespace: nil, consistency: nil, rerank_by: nil, vector_encoding: nil, request_options: {})
|
|
52
|
+
# @!method initialize(queries:, namespace: nil, consistency: nil, limit: nil, offset: nil, rerank_by: nil, vector_encoding: nil, request_options: {})
|
|
53
|
+
# Some parameter documentations has been truncated, see
|
|
54
|
+
# {Turbopuffer::Models::NamespaceMultiQueryParams} for more details.
|
|
55
|
+
#
|
|
40
56
|
# @param queries [Array<Turbopuffer::Models::NamespaceMultiQueryParams::Query>]
|
|
41
57
|
#
|
|
42
58
|
# @param namespace [String]
|
|
43
59
|
#
|
|
44
60
|
# @param consistency [Turbopuffer::Models::NamespaceMultiQueryParams::Consistency] The consistency level for a query.
|
|
45
61
|
#
|
|
62
|
+
# @param limit [Integer, Turbopuffer::Models::RerankLimit] Limits the total number of reranked documents returned.
|
|
63
|
+
#
|
|
64
|
+
# @param offset [Integer] Number of reranked documents to skip before returning results. Requires
|
|
65
|
+
# `rerank\_
|
|
66
|
+
#
|
|
46
67
|
# @param rerank_by [Object] How to combine the rows returned by each sub-query into a single ranked list.
|
|
47
68
|
#
|
|
48
69
|
# @param vector_encoding [Symbol, Turbopuffer::Models::VectorEncoding] The encoding to use for vectors in the response.
|
|
@@ -57,6 +78,14 @@ module Turbopuffer
|
|
|
57
78
|
# @return [Hash{Symbol=>Object}, nil]
|
|
58
79
|
optional :aggregate_by, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
59
80
|
|
|
81
|
+
# @!attribute compute_attributes
|
|
82
|
+
# Computes additional values on documents returned by a query. Each key is the
|
|
83
|
+
# name of the computed attribute; each value is an expression describing how to
|
|
84
|
+
# compute it.
|
|
85
|
+
#
|
|
86
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
87
|
+
optional :compute_attributes, Turbopuffer::Internal::Type::HashOf[Turbopuffer::Internal::Type::Unknown]
|
|
88
|
+
|
|
60
89
|
# @!attribute distance_metric
|
|
61
90
|
# A function used to calculate vector similarity.
|
|
62
91
|
#
|
|
@@ -96,6 +125,13 @@ module Turbopuffer
|
|
|
96
125
|
# @return [Integer, Turbopuffer::Models::Limit, nil]
|
|
97
126
|
optional :limit, union: -> { Turbopuffer::NamespaceMultiQueryParams::Query::Limit }
|
|
98
127
|
|
|
128
|
+
# @!attribute offset
|
|
129
|
+
# Number of documents to skip before returning results. Supported only in v2
|
|
130
|
+
# queries with an explicit `rank_by` and `top_k` or `limit`.
|
|
131
|
+
#
|
|
132
|
+
# @return [Integer, nil]
|
|
133
|
+
optional :offset, Integer
|
|
134
|
+
|
|
99
135
|
# @!attribute rank_by
|
|
100
136
|
# How to rank the documents in the namespace.
|
|
101
137
|
#
|
|
@@ -108,7 +144,7 @@ module Turbopuffer
|
|
|
108
144
|
# @return [Integer, nil]
|
|
109
145
|
optional :top_k, Integer
|
|
110
146
|
|
|
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)
|
|
147
|
+
# @!method initialize(aggregate_by: nil, compute_attributes: nil, distance_metric: nil, exclude_attributes: nil, filters: nil, group_by: nil, include_attributes: nil, limit: nil, offset: nil, rank_by: nil, top_k: nil)
|
|
112
148
|
# Some parameter documentations has been truncated, see
|
|
113
149
|
# {Turbopuffer::Models::NamespaceMultiQueryParams::Query} for more details.
|
|
114
150
|
#
|
|
@@ -116,6 +152,8 @@ module Turbopuffer
|
|
|
116
152
|
#
|
|
117
153
|
# @param aggregate_by [Hash{Symbol=>Object}] Aggregations to compute over all documents in the namespace that match the filte
|
|
118
154
|
#
|
|
155
|
+
# @param compute_attributes [Hash{Symbol=>Object}] Computes additional values on documents returned by a query. Each key is the nam
|
|
156
|
+
#
|
|
119
157
|
# @param distance_metric [Symbol, Turbopuffer::Models::DistanceMetric] A function used to calculate vector similarity.
|
|
120
158
|
#
|
|
121
159
|
# @param exclude_attributes [Array<String>] List of attribute names to exclude from the response. All other attributes will
|
|
@@ -128,6 +166,8 @@ module Turbopuffer
|
|
|
128
166
|
#
|
|
129
167
|
# @param limit [Integer, Turbopuffer::Models::Limit] Limits the documents returned by a query.
|
|
130
168
|
#
|
|
169
|
+
# @param offset [Integer] Number of documents to skip before returning results. Supported only in v2 queri
|
|
170
|
+
#
|
|
131
171
|
# @param rank_by [Object] How to rank the documents in the namespace.
|
|
132
172
|
#
|
|
133
173
|
# @param top_k [Integer] The number of results to return.
|
|
@@ -176,6 +216,19 @@ module Turbopuffer
|
|
|
176
216
|
# @return [Array<Symbol>]
|
|
177
217
|
end
|
|
178
218
|
end
|
|
219
|
+
|
|
220
|
+
# Limits the total number of reranked documents returned.
|
|
221
|
+
module Limit
|
|
222
|
+
extend Turbopuffer::Internal::Type::Union
|
|
223
|
+
|
|
224
|
+
variant Integer
|
|
225
|
+
|
|
226
|
+
# Limits the total number of reranked documents returned.
|
|
227
|
+
variant -> { Turbopuffer::RerankLimit }
|
|
228
|
+
|
|
229
|
+
# @!method self.variants
|
|
230
|
+
# @return [Array(Integer, Turbopuffer::Models::RerankLimit)]
|
|
231
|
+
end
|
|
179
232
|
end
|
|
180
233
|
end
|
|
181
234
|
end
|