agent2agent 1.1.0 → 1.1.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: fadb35d489fe59b7b010bafd2ee6e94adeb0d3cb0d8c6baa2d05fefcdd449fef
4
- data.tar.gz: 1fa489faf0e9f155d56d995bb49f208dbc4e28f9ae3bf84796b0bd4af02264b9
3
+ metadata.gz: 43f9f9cd543c06630586eb7ca1e389d8b2b6429aa378c0b6191c1e98bbf3191f
4
+ data.tar.gz: d5f41c6a497994e01da926886708b78fdce6700edfd5ec6ee818da4ccbd2e08a
5
5
  SHA512:
6
- metadata.gz: 7ce0595b5f4fbb554306d49fe40588ff16b9036e048012b946930d95143dd3f9f98db62cf7e53c9977b8b0d723e469dbe478aa524ee019da57fd1f29e5b90059
7
- data.tar.gz: 8caf8f2af8d3f8becdc7b1404ccaebd0333d05c0452cd68a49b59a0ab419bebed4886b1e8f35c1b7eb131a044cd11f97f5ba1ddc70bbf484f923b8bb55826e1e
6
+ metadata.gz: ae5e8f96ad9ae28ac237ec6b578e0a16e643ee23df9cd727758b8d3cccdd6eb135f94000dd4383d1c2af4b2f0f5a88dcb24f40a9eef3500a8f1eebe35e645a66
7
+ data.tar.gz: 7c2d7718f246add65270cb51f0ddca3840b04d360959348f1cc8c03440a339646f2f81c5b1318bb28aa01f9536fb1a1a0023a75679137026b48ee8bb3ccfecb6
data/lib/a2a/client.rb CHANGED
@@ -84,7 +84,6 @@ module A2A
84
84
  ::Faraday.new(url: @url) do |f|
85
85
  f.request :a2a_schema
86
86
  f.request :a2a_rest
87
- f.request :json
88
87
 
89
88
  f.response :a2a_rest
90
89
  f.response :json
@@ -31,10 +31,14 @@ module A2A
31
31
  env.method = operation.rest_verb.to_sym
32
32
 
33
33
  if [:get, :delete].include?(env.method)
34
+ env.params ||= {}
34
35
  remaining.each { |k, v| env.params[k.to_s] = v }
35
36
  env.body = nil
36
37
  else
37
- env.body = remaining
38
+ # Serialize to JSON here rather than relying on Faraday's
39
+ # built-in :json middleware, which only recognizes
40
+ # application/json and application/vnd.*+json content types.
41
+ env.body = remaining.is_a?(String) ? remaining : JSON.generate(remaining)
38
42
  env.request_headers["content-type"] = "application/a2a+json"
39
43
  end
40
44
  end
@@ -95,7 +99,7 @@ test do
95
99
 
96
100
  env.url.path.should == "/message:send"
97
101
  env.method.should == :post
98
- env.body.should == { "message" => { "role" => "ROLE_USER" } }
102
+ JSON.parse(env.body).should == { "message" => { "role" => "ROLE_USER" } }
99
103
  env.request_headers["content-type"].should == "application/a2a+json"
100
104
  end
101
105
 
@@ -148,7 +152,7 @@ test do
148
152
 
149
153
  env.url.path.should == "/tasks/task-123:cancel"
150
154
  env.method.should == :post
151
- env.body.should == { "metadata" => { "key" => "val" } }
155
+ JSON.parse(env.body).should == { "metadata" => { "key" => "val" } }
152
156
  end
153
157
 
154
158
  it "passes through when no operation is set" do
data/lib/a2a/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module A2A
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agent2agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - A2A Contributors