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.
62 63 64 65 66 |
# File 'lib/silas/connection.rb', line 62 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.
60 61 62 |
# File 'lib/silas/connection.rb', line 60 def session @session end |
Instance Method Details
#approval_policy ⇒ Object
68 |
# File 'lib/silas/connection.rb', line 68 def approval_policy = @connection.approval |
#call(**args) ⇒ Object
71 72 73 74 |
# File 'lib/silas/connection.rb', line 71 def call(**args) @client.call_tool(@remote_name, args.deep_stringify_keys) || { "isError" => true, "content" => [ { "type" => "text", "text" => "no result" } ] } end |
#effect_mode ⇒ Object
69 |
# File 'lib/silas/connection.rb', line 69 def effect_mode = @connection.effect |