baml 0.73.4-x86_64-linux-musl → 0.74.0-x86_64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8687af8f031c6d0c9d1c1e6c19275909f3676e9408a79bd56606ffb82c51ead9
4
- data.tar.gz: abc83b3b1ab262fb072c78758f9b137708c79934ff6e3db69ec2cf820c5f0e6c
3
+ metadata.gz: b24b05fd96ad9397d696fd3b91b8fdf76b9f87a203f8215c0d2809c70fefbdda
4
+ data.tar.gz: 97149ed04bf4b04458a806f7e703a1e46849667da617ca042a0504debeb8f641
5
5
  SHA512:
6
- metadata.gz: 9319d25688eaccae261233070a53dceb1cff5b069c5a20ac71f2deebaccb2f4c4e9ae33c904827b81b8242d5cddaa0962bde630be8dd0c2af576405cadb346ca
7
- data.tar.gz: b163d39f1c208ce0b30ba79bb08b3a0b68d5eee22affdaa0f8ffe3750b2473c4105804f9ac4d162dcedd0956750c6718b3c0f3ed54218fc8b794fe8c64d448c5
6
+ metadata.gz: '08809a5b6c588ffd2a33bfa13d92cc8c8ba73a5c8c3658c62b5d03ae9af33c4d60feda85f69386f035f5b46166f346bcf58a4008d263f3e722ef7ca26e6c49fc'
7
+ data.tar.gz: c9c31a2d86c90dd3186d60b5fed360cf9902a5d29a41974701c390dc5f0da8affef08941d1a7e03d5a0723e7ffe4858bf513dc65bc898106b72bae306f265111
Binary file
Binary file
Binary file
data/lib/baml.rb CHANGED
@@ -18,6 +18,9 @@ module Baml
18
18
  Checked = Baml::Checks::Checked
19
19
  Check = Baml::Checks::Check
20
20
 
21
+ # Reexport StreamState.
22
+ StreamState = Baml::StreamState::StreamState
23
+
21
24
  # Dynamically + idempotently define Baml::TypeConverter
22
25
  # NB: this does not respect raise_coercion_error = false
23
26
  def self.convert_to(type)
data/lib/stream.rb CHANGED
@@ -15,6 +15,24 @@ module Baml
15
15
  # end
16
16
  # end
17
17
 
18
+ module StreamState
19
+ class StreamState < T::Struct
20
+ extend T::Sig
21
+
22
+ extend T::Generic
23
+
24
+ Value = type_member
25
+
26
+ const :value, Value
27
+ const :state, Symbol
28
+
29
+ def initialize(props)
30
+ super(value: props[:value], state: props[:state])
31
+ end
32
+
33
+ end
34
+ end
35
+
18
36
  class BamlStream
19
37
  extend T::Sig
20
38
  extend T::Generic
@@ -47,7 +65,7 @@ module Baml
47
65
  # collection: https://ruby-doc.org/3.1.6/Enumerable.html#module-Enumerable-label-Usage
48
66
  if @final_response == nil
49
67
  @final_response = @ffi_stream.done(@ctx_manager) do |event|
50
- block.call event.parsed_using_types(Baml::PartialTypes)
68
+ block.call event.parsed_using_types(Baml::Types, Baml::PartialTypes, true)
51
69
  end
52
70
  end
53
71
 
@@ -64,7 +82,8 @@ module Baml
64
82
  @final_response = @ffi_stream.done(@ctx_manager)
65
83
  end
66
84
 
67
- @final_response.parsed_using_types(Baml::Types)
85
+ @final_response.parsed_using_types(Baml::Types, Baml::PartialTypes, false)
68
86
  end
69
87
  end
88
+
70
89
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: baml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.73.4
4
+ version: 0.74.0
5
5
  platform: x86_64-linux-musl
6
6
  authors:
7
7
  - BoundaryML
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-01-22 00:00:00.000000000 Z
11
+ date: 2025-01-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A gem for users to interact with BoundaryML's Language Model clients
14
14
  (LLM) in Ruby.