ai-agents 0.4.0 → 0.4.1
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/CHANGELOG.md +9 -0
- data/lib/agents/chat.rb +9 -0
- data/lib/agents/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5790a2b3414db7145124415d82571707270563e6c8e9f5ea15dc744cb861a2ae
|
4
|
+
data.tar.gz: 30cc3c836bb3df9de4ebc88f6e7c80907646d3998e21d66a114523df538d8835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b464b77e77ba64509dd7a2e4370f1f0e87494ceaa5161fbaa63cef1862e04f78a1b57a5e389e9d297f7272913978719ada9bc4d2831dc04c99eaf7b67ac5d5a
|
7
|
+
data.tar.gz: 9174870568c28280f4d3a72e06f2bd53243d118f2122ddfd6ba48e88c540b4504527562f44393798566661563e5ee28a12f82b3321745e44bf46b2cbc4b66c58
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.4.1] - 2025-08-04
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- **Structured Output JSON Parsing**: Fixed automatic JSON parsing for structured output responses
|
12
|
+
- Chat class now properly parses JSON string responses to Hash objects when schema is configured
|
13
|
+
- Maintains compatibility with RubyLLM's automatic parsing behavior from the documentation
|
14
|
+
- Gracefully handles invalid JSON by keeping original string content
|
15
|
+
- Added comprehensive test coverage for both valid and invalid JSON scenarios
|
16
|
+
|
8
17
|
## [0.4.0] - 2025-08-01
|
9
18
|
|
10
19
|
### Added
|
data/lib/agents/chat.rb
CHANGED
@@ -55,6 +55,15 @@ module Agents
|
|
55
55
|
)
|
56
56
|
@on[:end_message]&.call(response)
|
57
57
|
|
58
|
+
# Handle JSON parsing for structured output (like RubyLLM::Chat)
|
59
|
+
if @schema && response.content.is_a?(String)
|
60
|
+
begin
|
61
|
+
response.content = JSON.parse(response.content)
|
62
|
+
rescue JSON::ParserError
|
63
|
+
# If parsing fails, keep content as string
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
58
67
|
add_message(response)
|
59
68
|
|
60
69
|
if response.tool_call?
|
data/lib/agents/version.rb
CHANGED