Class: RcrewAI::Rails::Tool

Inherits:
ApplicationRecord show all
Defined in:
app/models/rcrewai/rails/tool.rb

Instance Method Summary collapse

Instance Method Details

#instantiated_toolObject



15
16
17
18
19
20
21
22
23
# File 'app/models/rcrewai/rails/tool.rb', line 15

def instantiated_tool
  return nil if tool_class.blank?
  
  klass = tool_class.constantize
  params = config || {}
  klass.new(**params.symbolize_keys)
rescue NameError
  nil
end