Class: Nanobot::Config::ToolsConfig
- Inherits:
-
Struct
- Object
- Struct
- Nanobot::Config::ToolsConfig
- Defined in:
- lib/nanobot/config/schema.rb
Overview
Aggregate configuration for all agent tools
Instance Attribute Summary collapse
-
#exec ⇒ Object
Returns the value of attribute exec.
-
#restrict_to_workspace ⇒ Object
Returns the value of attribute restrict_to_workspace.
-
#web ⇒ Object
Returns the value of attribute web.
Instance Method Summary collapse
-
#initialize(web: {}, exec: {}, restrict_to_workspace: true) ⇒ ToolsConfig
constructor
A new instance of ToolsConfig.
Constructor Details
#initialize(web: {}, exec: {}, restrict_to_workspace: true) ⇒ ToolsConfig
Returns a new instance of ToolsConfig.
108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/nanobot/config/schema.rb', line 108 def initialize(web: {}, exec: {}, restrict_to_workspace: true) web_config = web.is_a?(Hash) ? web : {} exec_config = exec.is_a?(Hash) ? exec : {} super( web: Struct.new(:search, keyword_init: true).new( search: WebSearchConfig.new(**(web_config[:search] || {})) ), exec: ExecToolConfig.new(**exec_config), restrict_to_workspace: restrict_to_workspace ) end |
Instance Attribute Details
#exec ⇒ Object
Returns the value of attribute exec
104 105 106 |
# File 'lib/nanobot/config/schema.rb', line 104 def exec @exec end |
#restrict_to_workspace ⇒ Object
Returns the value of attribute restrict_to_workspace
104 105 106 |
# File 'lib/nanobot/config/schema.rb', line 104 def restrict_to_workspace @restrict_to_workspace end |
#web ⇒ Object
Returns the value of attribute web
104 105 106 |
# File 'lib/nanobot/config/schema.rb', line 104 def web @web end |