ruby-openai-swarm 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 143ab1b153e54393e27a5a2f02d77c94ecaa8ed477d6ecdc2f072730b63ffd1f
4
- data.tar.gz: fa72888457647eefc2fedc5c5d97dcd1ccf7b2e35f1395eebf0500dc4a14fb22
3
+ metadata.gz: f7e19b63e6210a63fbec735601f6f8c969db926046910dc545a7a37178b06b5d
4
+ data.tar.gz: e43680dfddffac87d2953611c2c4d1749efc522fe316eecc5a1750de9c73f4c1
5
5
  SHA512:
6
- metadata.gz: 6b6830bb7dc3cb4e0512e0c5e0967ba7160b1967b5a44136923108df60cbb76450da27df55cadc9357a8a6c86d093db27dfbfdcf0f839e8db1e12114606055d7
7
- data.tar.gz: f8f67a146f3e089973e333a9ae39d2310779fa89648b91459ebcfe83029b4b6328852085cfb4179ae6627e60d802ff974ddaa8bebeee2f638fedcd89f1020e2a
6
+ metadata.gz: bd71a36f8c62cfc621e9d495e030387da1b0320ec2b668322b5dfa02fdd6c5faca2b64956c1419ce955569cffeed5d00dbd432c759a88f536270a67c99cdb030
7
+ data.tar.gz: 2a39291b7454cbffa4d0679596c272b8324a1c5c9c801d7853b0a88991c03d6f938c562d1d6469aa5ae7ccaece64dbc900ce80d77dd376fee01e1c76632801df
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-openai-swarm (0.2.6)
4
+ ruby-openai-swarm (0.2.7)
5
5
  ruby-openai (~> 7.3)
6
6
 
7
7
  GEM
@@ -65,4 +65,7 @@ params:
65
65
  GUIDE_EXAMPLES
66
66
  puts guide_examples
67
67
 
68
- OpenAISwarm::Repl.run_demo_loop(triage_agent, context_variables: context_variables, stream: true, debug: env_debug)
68
+ OpenAISwarm::Repl.run_demo_loop(triage_agent,
69
+ context_variables: context_variables,
70
+ debug: env_debug,
71
+ stream: true)
@@ -46,7 +46,6 @@ Details:
46
46
  Example: “What’s the weather in NYC?”
47
47
  Action: Calls get_weather with location “New York City”.
48
48
  Response: Only provides weather details.
49
-
50
49
  2. Multiple Function Calls
51
50
  Example: “Tell me the weather in New York and the latest news headlines.”
52
51
  Action: Calls get_weather for weather and get_news for news.
@@ -59,19 +58,4 @@ GUIDE_EXAMPLES
59
58
 
60
59
  puts guide_examples
61
60
 
62
- # OpenAISwarm::Repl.run_demo_loop(agent, stream: true, debug: env_debug)
63
-
64
- OpenAISwarm.new.run_and_stream(
65
- agent: agent,
66
- debug: true,
67
- messages: [{"role" => "user", "content" => "Tell me the weather in New York and the latest news headlines."}]
68
- ) do |chunk|
69
- if chunk.key?("content") && !chunk["content"].nil?
70
- puts ">>>#{chunk}"
71
- end
72
-
73
- if chunk.key?('response')
74
- binding.pry
75
- # log_llm_request(chunk['response'])
76
- end
77
- end
61
+ OpenAISwarm::Repl.run_demo_loop(agent, stream: true, debug: env_debug)
@@ -265,6 +265,14 @@ module OpenAISwarm
265
265
  history.concat(partial_response.messages)
266
266
  context_variables.merge!(partial_response.context_variables)
267
267
  active_agent = partial_response.agent if partial_response.agent
268
+
269
+ tool_call_messages = (Array.wrap(message) + partial_response.messages)
270
+ yield(
271
+ 'tool_call_messages' => Response.new(
272
+ messages: tool_call_messages,
273
+ agent: active_agent,
274
+ context_variables: context_variables)
275
+ ) if block_given?
268
276
  end
269
277
 
270
278
  yield(
@@ -1,3 +1,3 @@
1
1
  module OpenAISwarm
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-openai-swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grayson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-05 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-openai