Commit c76358b
Changed files (2)
lib
elelem
lib/elelem/configuration.rb
@@ -37,7 +37,14 @@ module Elelem
end
def conversation
- @conversation ||= Conversation.new
+ @conversation ||= Conversation.new.tap do |conversation|
+ resources = mcp_clients.map do |client|
+ client.resources.map do |resource|
+ resource["uri"]
+ end
+ end.flatten
+ conversation.add(role: :tool, content: resources)
+ end
end
def tools
lib/elelem/mcp_client.rb
@@ -71,7 +71,11 @@ module Elelem
Timeout.timeout(2) { @worker.value }
rescue Timeout::Error
# Force kill if it doesn't respond
- Process.kill("KILL", @worker.pid) rescue nil
+ begin
+ Process.kill("KILL", @worker.pid)
+ rescue StandardError
+ nil
+ end
rescue Errno::ESRCH
# Process already dead
end