dspy 0.15.4 → 0.15.5
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/README.md +2 -2
- data/lib/dspy/prediction.rb +18 -1
- data/lib/dspy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51c3198b48fd7a13694d7da2cd2e59d08c20feade0fa96d07a2722a1e68847be
|
4
|
+
data.tar.gz: 868a767f203a12e03df15395a22c8308d0a1a5bcbae2faf298ae05f36c026460
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa4b77bf91e75b93104a9059cf7549cb1d368f562dd5140a4e8bd57c923f1d9ad48a9cdc711829796a854f1f9bcb21339763015e6c498a65b925584e8e51fdd4
|
7
|
+
data.tar.gz: 234f127d1e947c824977b06a3d200f433316ef9900b2a666eac151987163e972493a7191eda45c1a2fa802accd5334f1e3154457d076b709f7f02b3fc500d1e6
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ The result? LLM applications that actually scale and don't break when you sneeze
|
|
47
47
|
|
48
48
|
## Development Status
|
49
49
|
|
50
|
-
DSPy.rb is actively developed and approaching stability at **v0.
|
50
|
+
DSPy.rb is actively developed and approaching stability at **v0.15.4**. The core framework is production-ready with comprehensive documentation, but I'm battle-testing features through the 0.x series before committing to a stable v1.0 API.
|
51
51
|
|
52
52
|
Real-world usage feedback is invaluable - if you encounter issues or have suggestions, please open a GitHub issue!
|
53
53
|
|
@@ -56,7 +56,7 @@ Real-world usage feedback is invaluable - if you encounter issues or have sugges
|
|
56
56
|
### Installation
|
57
57
|
|
58
58
|
```ruby
|
59
|
-
gem 'dspy', '~> 0.
|
59
|
+
gem 'dspy', '~> 0.15'
|
60
60
|
```
|
61
61
|
|
62
62
|
Or add to your Gemfile:
|
data/lib/dspy/prediction.rb
CHANGED
@@ -388,7 +388,17 @@ module DSPy
|
|
388
388
|
def needs_array_conversion?(type)
|
389
389
|
case type
|
390
390
|
when T::Types::TypedArray
|
391
|
-
needs_struct_conversion?(type.type)
|
391
|
+
needs_struct_conversion?(type.type) || is_enum_type?(type.type)
|
392
|
+
when T::Types::Union
|
393
|
+
# Handle nilable arrays: T.nilable(T::Array[...])
|
394
|
+
if is_nilable_type?(type)
|
395
|
+
# Find the non-nil type in the union
|
396
|
+
non_nil_type = type.types.find { |t| t != T::Utils.coerce(NilClass) }
|
397
|
+
# Recursively check if it needs array conversion
|
398
|
+
needs_array_conversion?(non_nil_type)
|
399
|
+
else
|
400
|
+
false
|
401
|
+
end
|
392
402
|
else
|
393
403
|
false
|
394
404
|
end
|
@@ -396,6 +406,13 @@ module DSPy
|
|
396
406
|
|
397
407
|
sig { params(array: T::Array[T.untyped], type: T.untyped).returns(T::Array[T.untyped]) }
|
398
408
|
def convert_array_elements(array, type)
|
409
|
+
# Handle nilable arrays: T.nilable(T::Array[...])
|
410
|
+
if type.is_a?(T::Types::Union) && is_nilable_type?(type)
|
411
|
+
# Find the non-nil type (should be TypedArray)
|
412
|
+
array_type = type.types.find { |t| t != T::Utils.coerce(NilClass) }
|
413
|
+
return convert_array_elements(array, array_type)
|
414
|
+
end
|
415
|
+
|
399
416
|
return array unless type.is_a?(T::Types::TypedArray)
|
400
417
|
|
401
418
|
element_type = type.type
|
data/lib/dspy/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dspy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vicente Reig Rincón de Arellano
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-08-
|
10
|
+
date: 2025-08-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: dry-configurable
|