baml 0.1.8-arm64-darwin → 0.1.10-arm64-darwin

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: c2d01cbd5ca6800a21ac72bb3f708ffb5b20ef86bd6e9102a5c9dcbf60874604
4
- data.tar.gz: 2acb1f122149e41a10d95146c834ab34d264bb56a2028b8d50f8c7367b45bd0e
3
+ metadata.gz: e4ac681e59d4f9d73d853921f553cf2188a0b7991bc4c9bca6932b0b36ddd475
4
+ data.tar.gz: 20ad926fd6f07b4dd8ae26051235122e3c183f51de5419a1b831e33d579c647c
5
5
  SHA512:
6
- metadata.gz: a15a9e541d2d4de73737c72cc9ff443d8b07fee096dccf911337a547c2ce09b0b9658dc48893be76fff65ec1acfbd7ecc3d9a3698947f8b58b76c852a2722704
7
- data.tar.gz: 67124711ac2be51312555d2593e9bcd87e48b1bb8dba1b6316c7e644bb7a82f51e85648b7bce9791b2e4eaac941989b8542717bca6986fa0e69a52948553e7f6
6
+ metadata.gz: 50f7846b8dc302253914dddede87755f1f359e0231b029d9ddd29a17857d88a7dd896ccf9d3f71b85a31d46dd5bcc48cd0874f026ad88dc8e97e4b700caf21a3
7
+ data.tar.gz: c4fe646f162559dacbed562c7d9ca3f0f19b08b63c10c8bc7cc179193dd5f6b8dc38648385f0628cbd0e700430cba66d802cbb945580f2f24b27dcc205d78a15
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/stream.rb CHANGED
@@ -26,13 +26,9 @@ module Baml
26
26
 
27
27
  def initialize(
28
28
  ffi_stream:,
29
- partial_coerce:,
30
- final_coerce:,
31
29
  ctx_manager:
32
30
  )
33
31
  @ffi_stream = ffi_stream
34
- @partial_coerce = partial_coerce
35
- @final_coerce = final_coerce
36
32
  @ctx_manager = ctx_manager
37
33
 
38
34
  @final_response = nil
@@ -45,12 +41,13 @@ module Baml
45
41
  #
46
42
  # @yieldparam [PartialType] event the parsed partial response
47
43
  # @return [BamlStream] self
44
+ sig { params(block: T.proc.params(event: PartialType).void).returns(BamlStream)}
48
45
  def each(&block)
49
46
  # Implementing this and include-ing Enumerable allows users to treat this as a Ruby
50
47
  # collection: https://ruby-doc.org/3.1.6/Enumerable.html#module-Enumerable-label-Usage
51
48
  if @final_response == nil
52
49
  @final_response = @ffi_stream.done(@ctx_manager) do |event|
53
- block.call @partial_coerce.new.from(event.parsed_using_types(Baml::PartialTypes))
50
+ block.call event.parsed_using_types(Baml::PartialTypes)
54
51
  end
55
52
  end
56
53
 
@@ -67,7 +64,7 @@ module Baml
67
64
  @final_response = @ffi_stream.done(@ctx_manager)
68
65
  end
69
66
 
70
- @final_coerce.new.from(@final_response.parsed_using_types(Baml::Types))
67
+ @final_response.parsed_using_types(Baml::Types)
71
68
  end
72
69
  end
73
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - BoundaryML