baml 0.52.1-arm64-darwin → 0.53.1-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 +4 -4
- data/lib/baml/3.1/ruby_ffi.bundle +0 -0
- data/lib/baml/3.2/ruby_ffi.bundle +0 -0
- data/lib/baml/3.3/ruby_ffi.bundle +0 -0
- data/lib/baml.rb +5 -2
- data/lib/struct.rb +66 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f2419b721b84110f7fb4df6679c947622a1679383e20a51aa22c500c0b5fcc4
|
4
|
+
data.tar.gz: 7646c77e311619fa6ed3d17dd64ad768b95434d39c4936d1440db86e943ac3ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f7e1492f1aa84fcc5e3e160c6a3e015afca90e16233cebd9dab60c3a0bf7f6e5217d93efe075f143b2dd8f7decd8279246fe7cf573f5762e68a30937464fe9e
|
7
|
+
data.tar.gz: cf00103274ab4d474034ef53b8a592de08ed6980afe9e1f0723e6eabab937891e9d6a1c6bde932fce6731b8b7210003484bc7a9b131d3098b5f39b11ffaec1e4
|
Binary file
|
Binary file
|
Binary file
|
data/lib/baml.rb
CHANGED
@@ -4,11 +4,14 @@ begin
|
|
4
4
|
rescue LoadError
|
5
5
|
require_relative "baml/ruby_ffi"
|
6
6
|
end
|
7
|
+
# require_relative "baml/ruby_ffi"
|
7
8
|
require_relative "stream"
|
9
|
+
require_relative "struct"
|
8
10
|
|
9
11
|
module Baml
|
10
|
-
|
11
|
-
|
12
|
+
ClientRegistry = Baml::Ffi::ClientRegistry
|
13
|
+
Image = Baml::Ffi::Image
|
14
|
+
Audio = Baml::Ffi::Audio
|
12
15
|
|
13
16
|
# Dynamically + idempotently define Baml::TypeConverter
|
14
17
|
# NB: this does not respect raise_coercion_error = false
|
data/lib/struct.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# This file should NOT be imported from baml.rb; we don't want
|
2
|
+
# to introduce a hard dependency on Sorbet for the baml gem.
|
3
|
+
require "ostruct"
|
4
|
+
#require "pp"
|
5
|
+
|
6
|
+
module Baml
|
7
|
+
module Sorbet
|
8
|
+
# Provides dynamic properties on statically defined classes
|
9
|
+
module Struct
|
10
|
+
# Needed to allow accessing dynamic types
|
11
|
+
def method_missing(symbol)
|
12
|
+
@props[symbol]
|
13
|
+
end
|
14
|
+
|
15
|
+
def eql?(other)
|
16
|
+
self.class == other.class &&
|
17
|
+
@props.eql?(other.instance_variable_get(:@args))
|
18
|
+
end
|
19
|
+
|
20
|
+
def hash
|
21
|
+
[self.class, @props].hash
|
22
|
+
end
|
23
|
+
|
24
|
+
def [](key)
|
25
|
+
key = key.to_sym if key.is_a?(String)
|
26
|
+
@props[key]
|
27
|
+
end
|
28
|
+
|
29
|
+
def inspect
|
30
|
+
PP.pp(self, +"", 79)
|
31
|
+
end
|
32
|
+
|
33
|
+
# https://docs.ruby-lang.org/en/master/PP.html
|
34
|
+
def pretty_print(pp)
|
35
|
+
pp.object_group(self) do
|
36
|
+
pp.breakable
|
37
|
+
@props.each do |key, value|
|
38
|
+
pp.text "#{key}="
|
39
|
+
pp.pp value
|
40
|
+
pp.comma_breakable unless key == @props.keys.last
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# From the ostruct implementation
|
46
|
+
def to_h(&block)
|
47
|
+
if block
|
48
|
+
@props.map(&block).to_h
|
49
|
+
else
|
50
|
+
@props.dup
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def to_json(*args)
|
55
|
+
@props.to_json(*args)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Dynamically defined output classes are instantiated using this class
|
61
|
+
class DynamicStruct < OpenStruct
|
62
|
+
def to_json(*args)
|
63
|
+
@table.to_json(*args)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
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.
|
4
|
+
version: 0.53.1
|
5
5
|
platform: arm64-darwin
|
6
6
|
authors:
|
7
7
|
- BoundaryML
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-11 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.
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/baml/3.2/ruby_ffi.bundle
|
26
26
|
- lib/baml/3.3/ruby_ffi.bundle
|
27
27
|
- lib/stream.rb
|
28
|
+
- lib/struct.rb
|
28
29
|
homepage: https://github.com/BoundaryML/baml
|
29
30
|
licenses:
|
30
31
|
- MIT
|