swarm_sdk 2.1.0 → 2.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: 64f83e4805438b3a6e47ebe1b0f01d8f8eaec78537e753be71740d96ef689a8e
4
- data.tar.gz: 0c73b64dd0fa3669c0ac19fca10e422a9c412c36fb602f78456cc9a21a797542
3
+ metadata.gz: 47978b1c12d2f651d9a6cf9d902e7eff40d46505e436039e53f39bc0d2b05341
4
+ data.tar.gz: ae2b9ac86ec9a6718a14e121c7b19198e519cbd028a236b7b58d8b4acb96d3b9
5
5
  SHA512:
6
- metadata.gz: 1314faae00ad4a91235261a5e78f0bc44f984be40c9f7e5d27c01602bad8a2bdd627da53307202ed5fcde20fbb145c41ea1f2ba42717db65c578945c455d3895
7
- data.tar.gz: 8bd2611db18c87dd9db6b1f9ba17378d8978332a395048a6756136c14cf9c5555ec070bd449556a436a01374f701c3921f950a1786106b656c04fecb75670890
6
+ metadata.gz: 48d1f64f551285a081d55ee10e98ba4a31b4b6ee55303b7516e2170bc78f08bc895e740f61eb37c8731196450546f44917ac6a1c98cbb8d0b345c6cda2f91bf7
7
+ data.tar.gz: da736412afc0e1565ea706b0680cc961531649143294f2bbfce6954ebd752cdfa87d039cfd965ae881942764b3549d102f9a1711a15fdf23980a906d3108142c
@@ -413,6 +413,18 @@ module SwarmSDK
413
413
  )
414
414
  end
415
415
 
416
+ # Handle nil response from provider (malformed API response)
417
+ if response.nil?
418
+ raise RubyLLM::Error, "Provider returned nil response. This usually indicates a malformed API response " \
419
+ "that couldn't be parsed.\n\n" \
420
+ "Provider: #{@provider.class.name}\n" \
421
+ "API Base: #{@provider.api_base}\n" \
422
+ "Model: #{@model.id}\n" \
423
+ "Response: #{response.inspect}\n\n" \
424
+ "The API endpoint returned a response that couldn't be parsed into a valid Message object. " \
425
+ "Enable RubyLLM debug logging (RubyLLM.logger.level = Logger::DEBUG) to see the raw API response."
426
+ end
427
+
416
428
  @on[:new_message]&.call unless block
417
429
 
418
430
  # Handle schema parsing if needed
@@ -834,6 +846,9 @@ module SwarmSDK
834
846
  when "openai", "deepseek", "perplexity", "mistral", "openrouter"
835
847
  config.openai_api_base = base_url
836
848
  config.openai_api_key = ENV["OPENAI_API_KEY"] || "dummy-key-for-local"
849
+ # Use standard 'system' role instead of 'developer' for OpenAI-compatible proxies
850
+ # Most proxies don't support OpenAI's newer 'developer' role convention
851
+ config.openai_use_system_role = true
837
852
  when "ollama"
838
853
  config.ollama_api_base = base_url
839
854
  when "gpustack"
@@ -72,6 +72,8 @@ module SwarmSDK
72
72
  back to earlier thinking. Use clear formatting and organization to make it easy to reference
73
73
  later. Don't hesitate to think out loud - this tool is designed to augment your cognitive capabilities and help
74
74
  you deliver better solutions.
75
+
76
+ **CRITICAL:** The Think tool takes only one parameter: thoughts. Do not include any other parameters.
75
77
  DESC
76
78
 
77
79
  param :thoughts,
@@ -79,9 +81,7 @@ module SwarmSDK
79
81
  desc: "Your thoughts, plans, calculations, or any notes you want to record",
80
82
  required: true
81
83
 
82
- def execute(thoughts:)
83
- return validation_error("thoughts are required") if thoughts.nil? || thoughts.empty?
84
-
84
+ def execute(**kwargs)
85
85
  "Thought noted."
86
86
  end
87
87
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SwarmSDK
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
5
5
  end
data/lib/swarm_sdk.rb CHANGED
@@ -17,8 +17,7 @@ require "async/semaphore"
17
17
  require "ruby_llm"
18
18
  require "ruby_llm/mcp"
19
19
 
20
- module SwarmSDK
21
- end
20
+ require_relative "swarm_sdk/version"
22
21
 
23
22
  require "zeitwerk"
24
23
  loader = Zeitwerk::Loader.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swarm_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda