turbopuffer 1.9.1 → 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: 5317a57b9e5ee7b9a97c67d3127944481e6ec1bb205145dda3c17c45f1cb9282
4
- data.tar.gz: c38a3da7c80cc45153758504a2d041de9c489b7e713ac103ef49b6ef9b975a02
3
+ metadata.gz: 851ae4810c0702115f3135705498260d1254ea835db48d18d624765d4483d958
4
+ data.tar.gz: dd6564d6e95b4c06d22e6b6eca38affa227a0aaeafbd041507067eb3aec661aa
5
5
  SHA512:
6
- metadata.gz: d7e734989c2ea71559c836afd0af03b2f4da88d90964f9f41c8fdbbb0df6b315b3ae8e67c5733773f3c3ee6016e21bd8bb129a0d16f55e4f11e6f2fa596cce2c
7
- data.tar.gz: 2911b8daa350bb6f35e5734fe8f0f1b677ca0f1ed91643bbbf0d3ce9074d23918008565a05dff8604596a82db1d3972d276448680c1cf00baac6782cec8bc7c8
6
+ metadata.gz: dcf2da5866fcd672ddea0c2129ce8e95bfef3642032d4137d676424ccb3bc0c429b22f5c8575d70daa4f4435d034dfb6811ab7167ad10db3540f1d55e3ee434f
7
+ data.tar.gz: af452eaabab8871d5747fbffba063262e7c0700dbf3188c5dbc908e9d9f1494a3bc3b6d47ccdc302d33760c22cbfd0a5528ed88ef3f7b189a28c0e74846a77cc
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
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
+
3
22
  ## 1.9.1 (2025-12-02)
4
23
 
5
24
  Full Changelog: [v1.9.0...v1.9.1](https://github.com/turbopuffer/turbopuffer-ruby/compare/v1.9.0...v1.9.1)
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.1"
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
@@ -175,13 +175,13 @@ module Turbopuffer
175
175
  required :source_namespace, String
176
176
 
177
177
  # @!attribute source_api_key
178
- # (Optional) An API key for the organization containing the source namespace
178
+ # An API key for the organization containing the source namespace
179
179
  #
180
180
  # @return [String, nil]
181
181
  optional :source_api_key, String
182
182
 
183
183
  # @!attribute source_region
184
- # (Optional) The region of the source namespace.
184
+ # The region of the source namespace.
185
185
  #
186
186
  # @return [String, nil]
187
187
  optional :source_region, String
@@ -189,9 +189,9 @@ module Turbopuffer
189
189
  # @!method initialize(source_namespace:, source_api_key: nil, source_region: nil)
190
190
  # @param source_namespace [String] The namespace to copy documents from.
191
191
  #
192
- # @param source_api_key [String] (Optional) An API key for the organization containing the source namespace
192
+ # @param source_api_key [String] An API key for the organization containing the source namespace
193
193
  #
194
- # @param source_region [String] (Optional) The region of the source namespace.
194
+ # @param source_region [String] The region of the source namespace.
195
195
  end
196
196
 
197
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.1"
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
@@ -320,14 +320,14 @@ module Turbopuffer
320
320
  sig { returns(String) }
321
321
  attr_accessor :source_namespace
322
322
 
323
- # (Optional) An API key for the organization containing the source namespace
323
+ # An API key for the organization containing the source namespace
324
324
  sig { returns(T.nilable(String)) }
325
325
  attr_reader :source_api_key
326
326
 
327
327
  sig { params(source_api_key: String).void }
328
328
  attr_writer :source_api_key
329
329
 
330
- # (Optional) The region of the source namespace.
330
+ # The region of the source namespace.
331
331
  sig { returns(T.nilable(String)) }
332
332
  attr_reader :source_region
333
333
 
@@ -344,9 +344,9 @@ module Turbopuffer
344
344
  def self.new(
345
345
  # The namespace to copy documents from.
346
346
  source_namespace:,
347
- # (Optional) An API key for the organization containing the source namespace
347
+ # An API key for the organization containing the source namespace
348
348
  source_api_key: nil,
349
- # (Optional) The region of the source namespace.
349
+ # The region of the source namespace.
350
350
  source_region: nil
351
351
  )
352
352
  end
@@ -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
@@ -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.1
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