Class: Silas::Connection::RemoteTool
- Inherits:
-
Object
- Object
- Silas::Connection::RemoteTool
- Defined in:
- lib/silas/connection.rb
Overview
One remote tool, resolved. Quacks like a resolved Silas::Tool for the Ledger (approval_policy / effect_mode / session= / call) without being a Silas::Tool subclass — its schema is the remote inputSchema.
Instance Attribute Summary collapse
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
- #approval_policy ⇒ Object
- #call(**args) ⇒ Object
- #effect_mode ⇒ Object
-
#initialize(connection:, remote_name:, client: nil) ⇒ RemoteTool
constructor
A new instance of RemoteTool.
Constructor Details
#initialize(connection:, remote_name:, client: nil) ⇒ RemoteTool
Returns a new instance of RemoteTool.
78 79 80 81 82 |
# File 'lib/silas/connection.rb', line 78 def initialize(connection:, remote_name:, client: nil) @connection = connection @remote_name = remote_name @client = client || connection.client end |
Instance Attribute Details
#session ⇒ Object
Returns the value of attribute session.
76 77 78 |
# File 'lib/silas/connection.rb', line 76 def session @session end |
Instance Method Details
#approval_policy ⇒ Object
84 |
# File 'lib/silas/connection.rb', line 84 def approval_policy = @connection.approval |
#call(**args) ⇒ Object
87 88 89 90 |
# File 'lib/silas/connection.rb', line 87 def call(**args) @client.call_tool(@remote_name, args.deep_stringify_keys) || { "isError" => true, "content" => [ { "type" => "text", "text" => "no result" } ] } end |
#effect_mode ⇒ Object
85 |
# File 'lib/silas/connection.rb', line 85 def effect_mode = @connection.effect |