Class: AgentHarness::Extensions::Adapters::PiExtension
- Includes:
- DeepDupable
- Defined in:
- lib/agent_harness/extensions.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#entry_paths ⇒ Object
readonly
Returns the value of attribute entry_paths.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source_path ⇒ Object
readonly
Returns the value of attribute source_path.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(name:, source_path:, entry_paths:, description: nil, version: nil, tools: [], system_prompt_additions: [], mcp_servers: [], required_provider_capabilities: [], unsupported_features: []) ⇒ PiExtension
constructor
A new instance of PiExtension.
- #mcp_servers ⇒ Object
- #required_provider_capabilities ⇒ Object
- #system_prompt_additions ⇒ Object
- #tools ⇒ Object
- #unsupported_features ⇒ Object
Methods inherited from Base
#on_message_after, #on_message_before, #on_tools_available
Constructor Details
#initialize(name:, source_path:, entry_paths:, description: nil, version: nil, tools: [], system_prompt_additions: [], mcp_servers: [], required_provider_capabilities: [], unsupported_features: []) ⇒ PiExtension
Returns a new instance of PiExtension.
317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/agent_harness/extensions.rb', line 317 def initialize(name:, source_path:, entry_paths:, description: nil, version: nil, tools: [], system_prompt_additions: [], mcp_servers: [], required_provider_capabilities: [], unsupported_features: []) @name = name.to_s.strip.gsub(/[^a-zA-Z0-9]+/, "_").gsub(/\A_+|_+\z/, "").downcase.to_sym @description = description @version = version @tools = tools.freeze @system_prompt_additions = system_prompt_additions.freeze @mcp_servers = mcp_servers.freeze @required_provider_capabilities = required_provider_capabilities.freeze @unsupported_features = unsupported_features.freeze @source_path = source_path @entry_paths = entry_paths.freeze end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
315 316 317 |
# File 'lib/agent_harness/extensions.rb', line 315 def description @description end |
#entry_paths ⇒ Object (readonly)
Returns the value of attribute entry_paths.
315 316 317 |
# File 'lib/agent_harness/extensions.rb', line 315 def entry_paths @entry_paths end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
315 316 317 |
# File 'lib/agent_harness/extensions.rb', line 315 def name @name end |
#source_path ⇒ Object (readonly)
Returns the value of attribute source_path.
315 316 317 |
# File 'lib/agent_harness/extensions.rb', line 315 def source_path @source_path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
315 316 317 |
# File 'lib/agent_harness/extensions.rb', line 315 def version @version end |
Instance Method Details
#mcp_servers ⇒ Object
336 337 338 |
# File 'lib/agent_harness/extensions.rb', line 336 def mcp_servers @mcp_servers.map { |server| deep_dup(server) } end |
#required_provider_capabilities ⇒ Object
344 345 346 347 348 349 |
# File 'lib/agent_harness/extensions.rb', line 344 def required_provider_capabilities inferred = [] inferred << :tool_use if @tools.any? inferred << :mcp if @mcp_servers.any? (@required_provider_capabilities + inferred).uniq end |
#system_prompt_additions ⇒ Object
340 341 342 |
# File 'lib/agent_harness/extensions.rb', line 340 def system_prompt_additions @system_prompt_additions.dup end |
#tools ⇒ Object
332 333 334 |
# File 'lib/agent_harness/extensions.rb', line 332 def tools @tools.map(&:dup) end |
#unsupported_features ⇒ Object
351 352 353 |
# File 'lib/agent_harness/extensions.rb', line 351 def unsupported_features @unsupported_features.dup end |