turbopuffer 2.4.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +1 -10
  4. data/lib/turbopuffer/client.rb +2 -2
  5. data/lib/turbopuffer/internal/type/union.rb +17 -7
  6. data/lib/turbopuffer/models/copy_from_namespace_operation.rb +84 -0
  7. data/lib/turbopuffer/models/copy_from_namespace_operation_result.rb +37 -0
  8. data/lib/turbopuffer/models/namespace_explain_query_params.rb +10 -1
  9. data/lib/turbopuffer/models/namespace_metadata.rb +21 -2
  10. data/lib/turbopuffer/models/namespace_metadata_patch.rb +10 -1
  11. data/lib/turbopuffer/models/namespace_multi_query_params.rb +45 -2
  12. data/lib/turbopuffer/models/namespace_poll_copy_from_params.rb +26 -0
  13. data/lib/turbopuffer/models/namespace_query_params.rb +10 -1
  14. data/lib/turbopuffer/models/namespace_start_copy_from_params.rb +53 -0
  15. data/lib/turbopuffer/models/namespace_start_copy_from_response.rb +17 -0
  16. data/lib/turbopuffer/models/operation_error.rb +46 -0
  17. data/lib/turbopuffer/models/rerank_limit.rb +18 -0
  18. data/lib/turbopuffer/models/write_result.rb +112 -0
  19. data/lib/turbopuffer/models.rb +14 -0
  20. data/lib/turbopuffer/resources/namespaces.rb +80 -4
  21. data/lib/turbopuffer/version.rb +1 -1
  22. data/lib/turbopuffer.rb +8 -0
  23. data/rbi/turbopuffer/client.rbi +2 -2
  24. data/rbi/turbopuffer/models/copy_from_namespace_operation.rbi +133 -0
  25. data/rbi/turbopuffer/models/copy_from_namespace_operation_result.rbi +85 -0
  26. data/rbi/turbopuffer/models/namespace_explain_query_params.rbi +13 -0
  27. data/rbi/turbopuffer/models/namespace_metadata.rbi +30 -1
  28. data/rbi/turbopuffer/models/namespace_metadata_patch.rbi +18 -3
  29. data/rbi/turbopuffer/models/namespace_multi_query_params.rbi +54 -0
  30. data/rbi/turbopuffer/models/namespace_poll_copy_from_params.rbi +49 -0
  31. data/rbi/turbopuffer/models/namespace_query_params.rbi +13 -0
  32. data/rbi/turbopuffer/models/namespace_start_copy_from_params.rbi +113 -0
  33. data/rbi/turbopuffer/models/namespace_start_copy_from_response.rbi +30 -0
  34. data/rbi/turbopuffer/models/operation_error.rbi +77 -0
  35. data/rbi/turbopuffer/models/rerank_limit.rbi +28 -0
  36. data/rbi/turbopuffer/models/write_result.rbi +159 -0
  37. data/rbi/turbopuffer/models.rbi +16 -0
  38. data/rbi/turbopuffer/resources/namespaces.rbi +71 -0
  39. data/sig/turbopuffer/models/copy_from_namespace_operation.rbs +65 -0
  40. data/sig/turbopuffer/models/copy_from_namespace_operation_result.rbs +33 -0
  41. data/sig/turbopuffer/models/namespace_explain_query_params.rbs +7 -0
  42. data/sig/turbopuffer/models/namespace_metadata.rbs +17 -1
  43. data/sig/turbopuffer/models/namespace_metadata_patch.rbs +12 -3
  44. data/sig/turbopuffer/models/namespace_multi_query_params.rbs +31 -0
  45. data/sig/turbopuffer/models/namespace_poll_copy_from_params.rbs +30 -0
  46. data/sig/turbopuffer/models/namespace_query_params.rbs +7 -0
  47. data/sig/turbopuffer/models/namespace_start_copy_from_params.rbs +56 -0
  48. data/sig/turbopuffer/models/namespace_start_copy_from_response.rbs +13 -0
  49. data/sig/turbopuffer/models/operation_error.rbs +34 -0
  50. data/sig/turbopuffer/models/rerank_limit.rbs +13 -0
  51. data/sig/turbopuffer/models/write_result.rbs +99 -0
  52. data/sig/turbopuffer/models.rbs +14 -0
  53. data/sig/turbopuffer/resources/namespaces.rbs +20 -0
  54. metadata +26 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 261de656879e46b1d9f2261ccd91ff7ea9e266d8a86607c5395ad55f38733dcf
4
- data.tar.gz: f747583237835002c070734cd7a3955c9476df205d5815e3fcf04ee10e9a8a76
3
+ metadata.gz: c7a74005340bd71314cefec78857e87f61242c5e99ca0619718932862dfb9b3e
4
+ data.tar.gz: 90568747fb99e6f0c3e07e135600cd49e48e806023059f27f0f270bb3f20ca20
5
5
  SHA512:
6
- metadata.gz: 9bc98d5c9e8d49f32361220486d44837ae507de3693b375b40d8ba6a668c9897efdeb60372d93da15a10493ca7a3b999c0962e7809ccd42514ec4c52230e96c8
7
- data.tar.gz: 022a2361e31a953a68d1867c5cc67ce571556e126ad873267ef2beb28ccf0e81438681570c86955134514a574c6812c374036b61fd5b0c88d8e642e62eb33c88
6
+ metadata.gz: e01efec060630c4a1b3840c93dc93148fd8724ffe326b7b697679a6d2a51eeecea9692ece6be917b3d42d7ed85ed1a958db57134f215b4290ab63f0c33521232
7
+ data.tar.gz: 9ce535511cfc814424db7cf0c6567b35724ddb1c75550224866a805040220b2daf28c9b0dfa686153f2a6e8a41c056066c29d0952a805594e7bda8cfe356351b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
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
+
3
22
  ## 2.4.0 (2026-07-30)
4
23
 
5
24
  Full Changelog: [v2.3.0...v2.4.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v2.3.0...v2.4.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
- [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40turbopuffer%2Fturbopuffer-mcp&config=eyJuYW1lIjoiQHR1cmJvcHVmZmVyL3R1cmJvcHVmZmVyLW1jcCIsInRyYW5zcG9ydCI6Imh0dHAiLCJ1cmwiOiJodHRwczovL3R1cmJvcHVmZmVyLnN0bG1jcC5jb20iLCJoZWFkZXJzIjp7IngtdHVyYm9wdWZmZXItYXBpLWtleSI6InRwdWZfQTEuLi4ifX0)
12
- [![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](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.4.0"
20
+ gem "turbopuffer", "~> 2.5.0"
30
21
  ```
31
22
 
32
23
  <!-- x-release-please-end -->
@@ -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
- # # `attribute_embed` is a `Turbopuffer::AttributeEmbed`
10
- # case attribute_embed
11
- # when String
12
- # # ...
13
- # when Turbopuffer::AttributeEmbedConfig
14
- # puts(attribute_embed.model)
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(attribute_embed)
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
@@ -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
@@ -72,6 +72,13 @@ module Turbopuffer
72
72
  # @return [Integer, Turbopuffer::Models::Limit, nil]
73
73
  optional :limit, union: -> { Turbopuffer::NamespaceExplainQueryParams::Limit }
74
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
+
75
82
  # @!attribute rank_by
76
83
  # How to rank the documents in the namespace.
77
84
  #
@@ -90,7 +97,7 @@ module Turbopuffer
90
97
  # @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
91
98
  optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
92
99
 
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: {})
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: {})
94
101
  # Some parameter documentations has been truncated, see
95
102
  # {Turbopuffer::Models::NamespaceExplainQueryParams} for more details.
96
103
  #
@@ -114,6 +121,8 @@ module Turbopuffer
114
121
  #
115
122
  # @param limit [Integer, Turbopuffer::Models::Limit] Limits the documents returned by a query.
116
123
  #
124
+ # @param offset [Integer] Number of documents to skip before returning results. Supported only in v2 queri
125
+ #
117
126
  # @param rank_by [Object] How to rank the documents in the namespace.
118
127
  #
119
128
  # @param top_k [Integer] The number of results to return.
@@ -52,6 +52,12 @@ module Turbopuffer
52
52
  # @return [Turbopuffer::Models::NamespaceMetadata::Pinning, nil]
53
53
  optional :pinning, -> { Turbopuffer::NamespaceMetadata::Pinning }
54
54
 
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
+
55
61
  # @!attribute sharding
56
62
  # Configuration for namespace sharding, which partitions a namespace's documents
57
63
  # across multiple internal shards to scale indexing and query throughput beyond a
@@ -61,7 +67,7 @@ module Turbopuffer
61
67
  # @return [Turbopuffer::Models::ShardingConfig, nil]
62
68
  optional :sharding, -> { Turbopuffer::ShardingConfig }
63
69
 
64
- # @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, encryption:, index:, schema:, updated_at:, pinning: nil, sharding: nil)
70
+ # @!method initialize(approx_logical_bytes:, approx_row_count:, created_at:, encryption:, index:, schema:, updated_at:, pinning: nil, read_only: nil, sharding: nil)
65
71
  # Some parameter documentations has been truncated, see
66
72
  # {Turbopuffer::Models::NamespaceMetadata} for more details.
67
73
  #
@@ -83,6 +89,8 @@ module Turbopuffer
83
89
  #
84
90
  # @param pinning [Turbopuffer::Models::NamespaceMetadata::Pinning] Configuration for namespace pinning, along with the current status of the pinned
85
91
  #
92
+ # @param read_only [Boolean] Whether document and schema writes are rejected. Omitted when `false`.
93
+ #
86
94
  # @param sharding [Turbopuffer::Models::ShardingConfig] Configuration for namespace sharding, which partitions a namespace's documents a
87
95
 
88
96
  # @see Turbopuffer::Models::NamespaceMetadata#index
@@ -150,6 +158,15 @@ module Turbopuffer
150
158
  # @return [Integer]
151
159
  required :ready_replicas, Integer
152
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
+
153
170
  # @!attribute updated_at
154
171
  # The timestamp of the latest pinning status snapshot.
155
172
  #
@@ -163,7 +180,7 @@ module Turbopuffer
163
180
  # @return [Float]
164
181
  required :utilization, Float
165
182
 
166
- # @!method initialize(ready_replicas:, updated_at:, utilization:)
183
+ # @!method initialize(ready_replicas:, replicas:, updated_at:, utilization:)
167
184
  # Some parameter documentations has been truncated, see
168
185
  # {Turbopuffer::Models::NamespaceMetadata::Pinning::Status} for more details.
169
186
  #
@@ -171,6 +188,8 @@ module Turbopuffer
171
188
  #
172
189
  # @param ready_replicas [Integer] The number of replicas that are warm and serving traffic.
173
190
  #
191
+ # @param replicas [Integer] The number of running replicas for the namespace. Replicas are billed once runni
192
+ #
174
193
  # @param updated_at [Time] The timestamp of the latest pinning status snapshot.
175
194
  #
176
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
- # @!method initialize(pinning: nil)
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.
@@ -104,6 +125,13 @@ module Turbopuffer
104
125
  # @return [Integer, Turbopuffer::Models::Limit, nil]
105
126
  optional :limit, union: -> { Turbopuffer::NamespaceMultiQueryParams::Query::Limit }
106
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
+
107
135
  # @!attribute rank_by
108
136
  # How to rank the documents in the namespace.
109
137
  #
@@ -116,7 +144,7 @@ module Turbopuffer
116
144
  # @return [Integer, nil]
117
145
  optional :top_k, Integer
118
146
 
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)
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)
120
148
  # Some parameter documentations has been truncated, see
121
149
  # {Turbopuffer::Models::NamespaceMultiQueryParams::Query} for more details.
122
150
  #
@@ -138,6 +166,8 @@ module Turbopuffer
138
166
  #
139
167
  # @param limit [Integer, Turbopuffer::Models::Limit] Limits the documents returned by a query.
140
168
  #
169
+ # @param offset [Integer] Number of documents to skip before returning results. Supported only in v2 queri
170
+ #
141
171
  # @param rank_by [Object] How to rank the documents in the namespace.
142
172
  #
143
173
  # @param top_k [Integer] The number of results to return.
@@ -186,6 +216,19 @@ module Turbopuffer
186
216
  # @return [Array<Symbol>]
187
217
  end
188
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
189
232
  end
190
233
  end
191
234
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#poll_copy_from
6
+ class NamespacePollCopyFromParams < Turbopuffer::Internal::Type::BaseModel
7
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
8
+ include Turbopuffer::Internal::Type::RequestParameters
9
+
10
+ # @!attribute namespace
11
+ #
12
+ # @return [String, nil]
13
+ optional :namespace, String
14
+
15
+ # @!attribute token
16
+ #
17
+ # @return [String]
18
+ required :token, String
19
+
20
+ # @!method initialize(token:, namespace: nil, request_options: {})
21
+ # @param token [String]
22
+ # @param namespace [String]
23
+ # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
24
+ end
25
+ end
26
+ end
@@ -72,6 +72,13 @@ module Turbopuffer
72
72
  # @return [Integer, Turbopuffer::Models::Limit, nil]
73
73
  optional :limit, union: -> { Turbopuffer::NamespaceQueryParams::Limit }
74
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
+
75
82
  # @!attribute rank_by
76
83
  # How to rank the documents in the namespace.
77
84
  #
@@ -90,7 +97,7 @@ module Turbopuffer
90
97
  # @return [Symbol, Turbopuffer::Models::VectorEncoding, nil]
91
98
  optional :vector_encoding, enum: -> { Turbopuffer::VectorEncoding }
92
99
 
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: {})
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: {})
94
101
  # Some parameter documentations has been truncated, see
95
102
  # {Turbopuffer::Models::NamespaceQueryParams} for more details.
96
103
  #
@@ -114,6 +121,8 @@ module Turbopuffer
114
121
  #
115
122
  # @param limit [Integer, Turbopuffer::Models::Limit] Limits the documents returned by a query.
116
123
  #
124
+ # @param offset [Integer] Number of documents to skip before returning results. Supported only in v2 queri
125
+ #
117
126
  # @param rank_by [Object] How to rank the documents in the namespace.
118
127
  #
119
128
  # @param top_k [Integer] The number of results to return.
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#start_copy_from
6
+ class NamespaceStartCopyFromParams < Turbopuffer::Internal::Type::BaseModel
7
+ extend Turbopuffer::Internal::Type::RequestParameters::Converter
8
+ include Turbopuffer::Internal::Type::RequestParameters
9
+
10
+ # @!attribute namespace
11
+ #
12
+ # @return [String, nil]
13
+ optional :namespace, String
14
+
15
+ # @!attribute source_namespace
16
+ # The namespace to copy documents from.
17
+ #
18
+ # @return [String]
19
+ required :source_namespace, String
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
+
27
+ # @!attribute source_api_key
28
+ # (Optional) An API key for the organization containing the source namespace
29
+ #
30
+ # @return [String, nil]
31
+ optional :source_api_key, String
32
+
33
+ # @!attribute source_region
34
+ # (Optional) The region of the source namespace.
35
+ #
36
+ # @return [String, nil]
37
+ optional :source_region, String
38
+
39
+ # @!method initialize(source_namespace:, namespace: nil, dest_encryption: nil, source_api_key: nil, source_region: nil, request_options: {})
40
+ # @param source_namespace [String] The namespace to copy documents from.
41
+ #
42
+ # @param namespace [String]
43
+ #
44
+ # @param dest_encryption [Turbopuffer::Models::Encryption::CustomerManaged, Turbopuffer::Models::Encryption::Default] (Optional) The encryption configuration for the destination namespace.
45
+ #
46
+ # @param source_api_key [String] (Optional) An API key for the organization containing the source namespace
47
+ #
48
+ # @param source_region [String] (Optional) The region of the source namespace.
49
+ #
50
+ # @param request_options [Turbopuffer::RequestOptions, Hash{Symbol=>Object}]
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ # @see Turbopuffer::Resources::Namespaces#start_copy_from
6
+ class NamespaceStartCopyFromResponse < Turbopuffer::Internal::Type::BaseModel
7
+ # @!attribute token
8
+ # The token identifying the copy operation.
9
+ #
10
+ # @return [String]
11
+ required :token, String
12
+
13
+ # @!method initialize(token:)
14
+ # @param token [String] The token identifying the copy operation.
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ class OperationError < Turbopuffer::Internal::Type::BaseModel
6
+ # @!attribute detail
7
+ # The response to an unsuccessful request.
8
+ #
9
+ # @return [Turbopuffer::Models::OperationError::Detail]
10
+ required :detail, -> { Turbopuffer::OperationError::Detail }
11
+
12
+ # @!attribute status_code
13
+ # The HTTP status code of the operation's error.
14
+ #
15
+ # @return [Integer]
16
+ required :status_code, Integer
17
+
18
+ # @!method initialize(detail:, status_code:)
19
+ # @param detail [Turbopuffer::Models::OperationError::Detail] The response to an unsuccessful request.
20
+ #
21
+ # @param status_code [Integer] The HTTP status code of the operation's error.
22
+
23
+ # @see Turbopuffer::Models::OperationError#detail
24
+ class Detail < Turbopuffer::Internal::Type::BaseModel
25
+ # @!attribute error
26
+ # The error message.
27
+ #
28
+ # @return [String]
29
+ required :error, String
30
+
31
+ # @!attribute status
32
+ # The status of the request.
33
+ #
34
+ # @return [Symbol, :error]
35
+ required :status, const: :error
36
+
37
+ # @!method initialize(error:, status: :error)
38
+ # The response to an unsuccessful request.
39
+ #
40
+ # @param error [String] The error message.
41
+ #
42
+ # @param status [Symbol, :error] The status of the request.
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Turbopuffer
4
+ module Models
5
+ class RerankLimit < Turbopuffer::Internal::Type::BaseModel
6
+ # @!attribute total
7
+ # Limits the total number of documents returned after reranking.
8
+ #
9
+ # @return [Integer]
10
+ required :total, Integer
11
+
12
+ # @!method initialize(total:)
13
+ # Limits the total number of reranked documents returned.
14
+ #
15
+ # @param total [Integer] Limits the total number of documents returned after reranking.
16
+ end
17
+ end
18
+ end