baml 0.73.5-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: 2d17164c42fc850826d22b57d93302c4bafbe9e6f666a4ba75eb53531bcfb2eb
4
- data.tar.gz: 0f825f5f74c15dbb23a256db9c0b6214430ef69d81d693e3a23ef629a63e73bf
3
+ metadata.gz: b24b05fd96ad9397d696fd3b91b8fdf76b9f87a203f8215c0d2809c70fefbdda
4
+ data.tar.gz: 97149ed04bf4b04458a806f7e703a1e46849667da617ca042a0504debeb8f641
5
5
  SHA512:
6
- metadata.gz: e933cc4e389d5612346e49e2abd754017ff11cbe4ad50aa981e78be1443c7750c863247f7a31efd37121cca51b1c2d4570e963c1c2242fbcd15559112e6bdf4b
7
- data.tar.gz: f76bc531f791cb3de5a2851ac801f80bce700f26357a5f14d9ba9a05240f771ceac0e160c76477bc77a5b80ff2fe773e78ba95850859c416f2d186af1c6808b8
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.5
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-27 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.