turbopuffer 1.9.0 → 1.10.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36b14ea176033e79cc636aede611ed70df4d05dd49770b6047ef057a8e787282
4
- data.tar.gz: be5df7041b1aebd94037fe89ad0b212189a70d8e5d30182aa58716d0ea2e5638
3
+ metadata.gz: 851ae4810c0702115f3135705498260d1254ea835db48d18d624765d4483d958
4
+ data.tar.gz: dd6564d6e95b4c06d22e6b6eca38affa227a0aaeafbd041507067eb3aec661aa
5
5
  SHA512:
6
- metadata.gz: ed257494a1fbdf9dd8c37cead131ca0b59377e2242712ba3cf7f348b0ca7cfaf026bd119ff3355ea042f0c366ae1f9aae019685685d6c6ad45df94925cc207af
7
- data.tar.gz: 27933b39dd696f73de2e0009b58183297fa71f77f53d02bad6621d0359cc3db43d10feb38eedb31ba2b0cf493c5158b8143944750934732bf8533b6d69a45807
6
+ metadata.gz: dcf2da5866fcd672ddea0c2129ce8e95bfef3642032d4137d676424ccb3bc0c429b22f5c8575d70daa4f4435d034dfb6811ab7167ad10db3540f1d55e3ee434f
7
+ data.tar.gz: af452eaabab8871d5747fbffba063262e7c0700dbf3188c5dbc908e9d9f1494a3bc3b6d47ccdc302d33760c22cbfd0a5528ed88ef3f7b189a28c0e74846a77cc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.0 (2025-12-18)
4
+
5
+ Full Changelog: [v1.9.1...v1.10.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.9.1...v1.10.0)
6
+
7
+ ### Features
8
+
9
+ * add word_v3 to the spec ([b484b4b](https://github.com/turbopuffer/turbopuffer-ruby/commit/b484b4b23f7ada10116c46ccbc3ed5476077eea4))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * calling `break` out of streams should be instantaneous ([42f9fe1](https://github.com/turbopuffer/turbopuffer-ruby/commit/42f9fe1d5160bf02e7299db28cf3d45630dfabe0))
15
+ * issue where json.parse errors when receiving HTTP 204 with nobody ([fcbd409](https://github.com/turbopuffer/turbopuffer-ruby/commit/fcbd409ff069545dffc700c4c05ace36d6c39fe9))
16
+
17
+
18
+ ### Chores
19
+
20
+ * codegen updates ([fef9366](https://github.com/turbopuffer/turbopuffer-ruby/commit/fef9366834e72a7b966aa0695718240026b44ebf))
21
+
22
+ ## 1.9.1 (2025-12-02)
23
+
24
+ Full Changelog: [v1.9.0...v1.9.1](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.9.0...v1.9.1)
25
+
26
+ ### Documentation
27
+
28
+ * add cross-region copy_from_namespace to write API docs ([bf6a887](https://github.com/turbopuffer/turbopuffer-ruby/commit/bf6a8873718ce040cf6677bca238069fff8a4950))
29
+
3
30
  ## 1.9.0 (2025-12-02)
4
31
 
5
32
  Full Changelog: [v1.8.0...v1.9.0](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.8.0...v1.9.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "turbopuffer", "~> 1.9.0"
20
+ gem "turbopuffer", "~> 1.10.0"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -153,17 +153,19 @@ module Turbopuffer
153
153
  end
154
154
 
155
155
  self.class.calibrate_socket_timeout(conn, deadline)
156
- conn.request(req) do |rsp|
157
- y << [req, rsp]
158
- break if finished
159
-
160
- rsp.read_body do |bytes|
161
- y << bytes.force_encoding(Encoding::BINARY)
162
- break if finished
163
-
164
- self.class.calibrate_socket_timeout(conn, deadline)
156
+ ::Kernel.catch(:jump) do
157
+ conn.request(req) do |rsp|
158
+ y << [req, rsp]
159
+ ::Kernel.throw(:jump) if finished
160
+
161
+ rsp.read_body do |bytes|
162
+ y << bytes.force_encoding(Encoding::BINARY)
163
+ ::Kernel.throw(:jump) if finished
164
+
165
+ self.class.calibrate_socket_timeout(conn, deadline)
166
+ end
167
+ eof = true
165
168
  end
166
- eof = true
167
169
  end
168
170
  end
169
171
  ensure
@@ -657,7 +657,8 @@ module Turbopuffer
657
657
  def decode_content(headers, stream:, suppress_error: false)
658
658
  case (content_type = headers["content-type"])
659
659
  in Turbopuffer::Internal::Util::JSON_CONTENT
660
- json = stream.to_a.join
660
+ return nil if (json = stream.to_a.join).empty?
661
+
661
662
  begin
662
663
  JSON.parse(json, symbolize_names: true)
663
664
  rescue JSON::ParserError => e
@@ -667,7 +668,11 @@ module Turbopuffer
667
668
  in Turbopuffer::Internal::Util::JSONL_CONTENT
668
669
  lines = decode_lines(stream)
669
670
  chain_fused(lines) do |y|
670
- lines.each { y << JSON.parse(_1, symbolize_names: true) }
671
+ lines.each do
672
+ next if _1.empty?
673
+
674
+ y << JSON.parse(_1, symbolize_names: true)
675
+ end
671
676
  end
672
677
  in %r{^text/event-stream}
673
678
  lines = decode_lines(stream)
@@ -59,7 +59,7 @@ module Turbopuffer
59
59
 
60
60
  # @!attribute tokenizer
61
61
  # The tokenizer to use for full-text search on an attribute. Defaults to
62
- # `word_v2`.
62
+ # `word_v3`.
63
63
  #
64
64
  # @return [Symbol, Turbopuffer::Models::Tokenizer, nil]
65
65
  optional :tokenizer, enum: -> { Turbopuffer::Tokenizer }
@@ -86,7 +86,7 @@ module Turbopuffer
86
86
  #
87
87
  # @param stemming [Boolean] Language-specific stemming for the text. Defaults to `false` (i.e., do not stem)
88
88
  #
89
- # @param tokenizer [Symbol, Turbopuffer::Models::Tokenizer] The tokenizer to use for full-text search on an attribute. Defaults to `word_v2`
89
+ # @param tokenizer [Symbol, Turbopuffer::Models::Tokenizer] The tokenizer to use for full-text search on an attribute. Defaults to `word_v3`
90
90
  end
91
91
  end
92
92
  end
@@ -168,22 +168,30 @@ module Turbopuffer
168
168
  variant -> { Turbopuffer::NamespaceWriteParams::CopyFromNamespace::CopyFromNamespaceConfig }
169
169
 
170
170
  class CopyFromNamespaceConfig < Turbopuffer::Internal::Type::BaseModel
171
- # @!attribute source_api_key
172
- # An API key for the organization containing the source namespace
173
- #
174
- # @return [String]
175
- required :source_api_key, String
176
-
177
171
  # @!attribute source_namespace
178
172
  # The namespace to copy documents from.
179
173
  #
180
174
  # @return [String]
181
175
  required :source_namespace, String
182
176
 
183
- # @!method initialize(source_api_key:, source_namespace:)
184
- # @param source_api_key [String] An API key for the organization containing the source namespace
177
+ # @!attribute source_api_key
178
+ # An API key for the organization containing the source namespace
179
+ #
180
+ # @return [String, nil]
181
+ optional :source_api_key, String
182
+
183
+ # @!attribute source_region
184
+ # The region of the source namespace.
185
185
  #
186
+ # @return [String, nil]
187
+ optional :source_region, String
188
+
189
+ # @!method initialize(source_namespace:, source_api_key: nil, source_region: nil)
186
190
  # @param source_namespace [String] The namespace to copy documents from.
191
+ #
192
+ # @param source_api_key [String] An API key for the organization containing the source namespace
193
+ #
194
+ # @param source_region [String] The region of the source namespace.
187
195
  end
188
196
 
189
197
  # @!method self.variants
@@ -3,7 +3,7 @@
3
3
  module Turbopuffer
4
4
  module Models
5
5
  # The tokenizer to use for full-text search on an attribute. Defaults to
6
- # `word_v2`.
6
+ # `word_v3`.
7
7
  module Tokenizer
8
8
  extend Turbopuffer::Internal::Type::Enum
9
9
 
@@ -11,6 +11,7 @@ module Turbopuffer
11
11
  WORD_V0 = :word_v0
12
12
  WORD_V1 = :word_v1
13
13
  WORD_V2 = :word_v2
14
+ WORD_V3 = :word_v3
14
15
 
15
16
  # @!method self.values
16
17
  # @return [Array<Symbol>]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Turbopuffer
4
- VERSION = "1.9.0"
4
+ VERSION = "1.10.0"
5
5
  end
@@ -74,7 +74,7 @@ module Turbopuffer
74
74
  attr_writer :stemming
75
75
 
76
76
  # The tokenizer to use for full-text search on an attribute. Defaults to
77
- # `word_v2`.
77
+ # `word_v3`.
78
78
  sig { returns(T.nilable(Turbopuffer::Tokenizer::OrSymbol)) }
79
79
  attr_reader :tokenizer
80
80
 
@@ -119,7 +119,7 @@ module Turbopuffer
119
119
  # stem).
120
120
  stemming: nil,
121
121
  # The tokenizer to use for full-text search on an attribute. Defaults to
122
- # `word_v2`.
122
+ # `word_v3`.
123
123
  tokenizer: nil
124
124
  )
125
125
  end
@@ -316,30 +316,48 @@ module Turbopuffer
316
316
  )
317
317
  end
318
318
 
319
- # An API key for the organization containing the source namespace
320
- sig { returns(String) }
321
- attr_accessor :source_api_key
322
-
323
319
  # The namespace to copy documents from.
324
320
  sig { returns(String) }
325
321
  attr_accessor :source_namespace
326
322
 
323
+ # An API key for the organization containing the source namespace
324
+ sig { returns(T.nilable(String)) }
325
+ attr_reader :source_api_key
326
+
327
+ sig { params(source_api_key: String).void }
328
+ attr_writer :source_api_key
329
+
330
+ # The region of the source namespace.
331
+ sig { returns(T.nilable(String)) }
332
+ attr_reader :source_region
333
+
334
+ sig { params(source_region: String).void }
335
+ attr_writer :source_region
336
+
327
337
  sig do
328
- params(source_api_key: String, source_namespace: String).returns(
329
- T.attached_class
330
- )
338
+ params(
339
+ source_namespace: String,
340
+ source_api_key: String,
341
+ source_region: String
342
+ ).returns(T.attached_class)
331
343
  end
332
344
  def self.new(
333
- # An API key for the organization containing the source namespace
334
- source_api_key:,
335
345
  # The namespace to copy documents from.
336
- source_namespace:
346
+ source_namespace:,
347
+ # An API key for the organization containing the source namespace
348
+ source_api_key: nil,
349
+ # The region of the source namespace.
350
+ source_region: nil
337
351
  )
338
352
  end
339
353
 
340
354
  sig do
341
355
  override.returns(
342
- { source_api_key: String, source_namespace: String }
356
+ {
357
+ source_namespace: String,
358
+ source_api_key: String,
359
+ source_region: String
360
+ }
343
361
  )
344
362
  end
345
363
  def to_hash
@@ -3,7 +3,7 @@
3
3
  module Turbopuffer
4
4
  module Models
5
5
  # The tokenizer to use for full-text search on an attribute. Defaults to
6
- # `word_v2`.
6
+ # `word_v3`.
7
7
  module Tokenizer
8
8
  extend Turbopuffer::Internal::Type::Enum
9
9
 
@@ -15,6 +15,7 @@ module Turbopuffer
15
15
  WORD_V0 = T.let(:word_v0, Turbopuffer::Tokenizer::TaggedSymbol)
16
16
  WORD_V1 = T.let(:word_v1, Turbopuffer::Tokenizer::TaggedSymbol)
17
17
  WORD_V2 = T.let(:word_v2, Turbopuffer::Tokenizer::TaggedSymbol)
18
+ WORD_V3 = T.let(:word_v3, Turbopuffer::Tokenizer::TaggedSymbol)
18
19
 
19
20
  sig { override.returns(T::Array[Turbopuffer::Tokenizer::TaggedSymbol]) }
20
21
  def self.values
@@ -163,19 +163,34 @@ module Turbopuffer
163
163
  extend Turbopuffer::Internal::Type::Union
164
164
 
165
165
  type copy_from_namespace_config =
166
- { source_api_key: String, source_namespace: String }
166
+ {
167
+ source_namespace: String,
168
+ source_api_key: String,
169
+ source_region: String
170
+ }
167
171
 
168
172
  class CopyFromNamespaceConfig < Turbopuffer::Internal::Type::BaseModel
169
- attr_accessor source_api_key: String
170
-
171
173
  attr_accessor source_namespace: String
172
174
 
175
+ attr_reader source_api_key: String?
176
+
177
+ def source_api_key=: (String) -> String
178
+
179
+ attr_reader source_region: String?
180
+
181
+ def source_region=: (String) -> String
182
+
173
183
  def initialize: (
174
- source_api_key: String,
175
- source_namespace: String
184
+ source_namespace: String,
185
+ ?source_api_key: String,
186
+ ?source_region: String
176
187
  ) -> void
177
188
 
178
- def to_hash: -> { source_api_key: String, source_namespace: String }
189
+ def to_hash: -> {
190
+ source_namespace: String,
191
+ source_api_key: String,
192
+ source_region: String
193
+ }
179
194
  end
180
195
 
181
196
  def self?.variants: -> ::Array[Turbopuffer::Models::NamespaceWriteParams::copy_from_namespace]
@@ -1,6 +1,7 @@
1
1
  module Turbopuffer
2
2
  module Models
3
- type tokenizer = :pre_tokenized_array | :word_v0 | :word_v1 | :word_v2
3
+ type tokenizer =
4
+ :pre_tokenized_array | :word_v0 | :word_v1 | :word_v2 | :word_v3
4
5
 
5
6
  module Tokenizer
6
7
  extend Turbopuffer::Internal::Type::Enum
@@ -9,6 +10,7 @@ module Turbopuffer
9
10
  WORD_V0: :word_v0
10
11
  WORD_V1: :word_v1
11
12
  WORD_V2: :word_v2
13
+ WORD_V3: :word_v3
12
14
 
13
15
  def self?.values: -> ::Array[Turbopuffer::Models::tokenizer]
14
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbopuffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Turbopuffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-12-02 00:00:00.000000000 Z
11
+ date: 2025-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool