Class: Silas::NamedAgent
- Inherits:
-
Object
- Object
- Silas::NamedAgent
- Defined in:
- lib/silas/named_agent.rb
Overview
Handle for a named top-level agent (app/agents/
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(scope) ⇒ NamedAgent
constructor
A new instance of NamedAgent.
- #limits ⇒ Object
- #max_cost ⇒ Object
- #max_input_tokens ⇒ Object
- #max_steps ⇒ Object
-
#model ⇒ Object
Definition readers delegate to the scope's parsed agent.yml.
- #name ⇒ Object
- #start(input:, metadata: {}, channel: nil, continuation_token: nil) ⇒ Object
- #timeout ⇒ Object
Constructor Details
#initialize(scope) ⇒ NamedAgent
Returns a new instance of NamedAgent.
10 11 12 |
# File 'lib/silas/named_agent.rb', line 10 def initialize(scope) @scope = scope end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
8 9 10 |
# File 'lib/silas/named_agent.rb', line 8 def scope @scope end |
Instance Method Details
#description ⇒ Object
25 |
# File 'lib/silas/named_agent.rb', line 25 def description = scope.agent.description |
#limits ⇒ Object
26 |
# File 'lib/silas/named_agent.rb', line 26 def limits = scope.agent.limits |
#max_cost ⇒ Object
29 |
# File 'lib/silas/named_agent.rb', line 29 def max_cost = scope.agent.max_cost |
#max_input_tokens ⇒ Object
28 |
# File 'lib/silas/named_agent.rb', line 28 def max_input_tokens = scope.agent.max_input_tokens |
#max_steps ⇒ Object
27 |
# File 'lib/silas/named_agent.rb', line 27 def max_steps = scope.agent.max_steps |
#model ⇒ Object
Definition readers delegate to the scope's parsed agent.yml.
24 |
# File 'lib/silas/named_agent.rb', line 24 def model = scope.agent.model |
#name ⇒ Object
14 |
# File 'lib/silas/named_agent.rb', line 14 def name = scope.name |
#start(input:, metadata: {}, channel: nil, continuation_token: nil) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/silas/named_agent.rb', line 16 def start(input:, metadata: {}, channel: nil, continuation_token: nil) session = Session.create!(agent_name: name, metadata: , channel: channel, continuation_token: continuation_token) session.continue(input: input) session end |
#timeout ⇒ Object
30 |
# File 'lib/silas/named_agent.rb', line 30 def timeout = scope.agent.timeout |