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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a2d71857e9614f2dad748a9510a5f29925cf070dd7a7dad59ac8a243eadbc28
4
- data.tar.gz: e0f836ad647303fdd3482ca1f1d144bda34573d74ff8741487a4a0b550860f01
3
+ metadata.gz: 5790a2b3414db7145124415d82571707270563e6c8e9f5ea15dc744cb861a2ae
4
+ data.tar.gz: 30cc3c836bb3df9de4ebc88f6e7c80907646d3998e21d66a114523df538d8835
5
5
  SHA512:
6
- metadata.gz: 2728cc0f9e4b377c438ecfd73db1ff0e72e3399f8c5602c330b78fcfb53f081bbd80e44bb3036549f0b906b8df09da5ecff371af3b895f7b0e98645e74809967
7
- data.tar.gz: c22baa1ce3c5aef5e1a2d17e208eb040f49edb46f4d275946e93fab506dcb3cc40eb1dfc9638f62beadec19a61421fe27d9fe079268b0b867b7c787a2c31cb19
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?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Agents
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai-agents
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shivam Mishra