baml 0.73.5-arm64-darwin → 0.74.0-arm64-darwin

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: 4170193a596785c4cd223bd21002ed4e47f4c2a0ecd2ba311945a2c8efce8cfc
4
- data.tar.gz: 56bcafc661166275fab565eecb657dab696de70c06b40c1095ae652a1f6aba13
3
+ metadata.gz: d9e6694aa3783e01e1d49b9557ef534f4731b27061d379075afb15f47e611206
4
+ data.tar.gz: 1467b3db3a1ab04757b1b06fc13f386833faf0f33d3495c42e658cd91c662766
5
5
  SHA512:
6
- metadata.gz: 21d976e322591b4f76757c0ec83c0b6108fed930b580e81a0a32f09277b094adfc167a511c2321ac4d751b8f4256c4f29fd6ebeda58212f981c9e5b7b4864b27
7
- data.tar.gz: cf4e940333d26ce752e2935182c9eb15468653f5b9a6c99cd8eceb9d385046adfd63886694c7186572c1e70be337b05c8d9b836e76ef5ceffa939cba635d0849
6
+ metadata.gz: a719369fb4375dbf5b099a22ac641e05f8c975648ffcc124562868bde3651c6946b93659fc78db1f9e6fd1c07566b068b33db6f0e70d9c0ec61aa2813c54eb38
7
+ data.tar.gz: 45252914b5a778b793652f6afd45d76023e84b7aeb922f8a091e9739a18747ed77393e7348c39f48c21dd49cd3b7a26a8cd508ab6ca41919ba111a30251fd67a
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: arm64-darwin
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.