ruby_llm_swarm 1.9.2 → 1.9.3

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.
@@ -115,6 +115,8 @@ module RubyLLM
115
115
  else
116
116
  body
117
117
  end
118
+ rescue NoMethodError
119
+ response.body
118
120
  end
119
121
 
120
122
  def format_messages(messages)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyLLM
4
- VERSION = '1.9.2'
4
+ VERSION = '1.9.3'
5
5
  end
data/lib/ruby_llm.rb CHANGED
@@ -12,6 +12,35 @@ require 'securerandom'
12
12
  require 'zeitwerk'
13
13
  require 'async/http/faraday/default'
14
14
 
15
+ # Monkey-patch io-endpoint to handle EHOSTUNREACH (IPv6 unreachable)
16
+ # This fixes an issue where the async adapter fails on IPv6 without trying IPv4
17
+ # See: https://github.com/socketry/io-endpoint/issues/XXX
18
+ module IO::Endpoint
19
+ class HostEndpoint < Generic
20
+ def connect(wrapper = self.wrapper, &block)
21
+ last_error = nil
22
+
23
+ Addrinfo.foreach(*@specification) do |address|
24
+ begin
25
+ socket = wrapper.connect(address, **@options)
26
+ rescue Errno::ECONNREFUSED, Errno::ENETUNREACH, Errno::EHOSTUNREACH, Errno::EAGAIN => last_error
27
+ # Try next address
28
+ else
29
+ return socket unless block_given?
30
+
31
+ begin
32
+ return yield(socket)
33
+ ensure
34
+ socket.close
35
+ end
36
+ end
37
+ end
38
+
39
+ raise last_error
40
+ end
41
+ end
42
+ end
43
+
15
44
  loader = Zeitwerk::Loader.for_gem
16
45
  loader.inflector.inflect(
17
46
  'ruby_llm' => 'RubyLLM',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_llm_swarm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.2
4
+ version: 1.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paulo Arruda