Class: SimpleAcp::Models::AwaitRequest Abstract
- Defined in:
- lib/simple_acp/models/await.rb
Overview
This class is abstract.
Subclass for specific await types
Base class for await requests.
When an agent needs client input during execution, it creates an await request describing what input is needed.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#type ⇒ String
readonly
Await request type.
Class Method Summary collapse
-
.from_hash(hash) ⇒ AwaitRequest?
Parse from hash, creating the appropriate subclass.
Methods inherited from Base
#==, attribute, attributes, #hash, #initialize, own_attributes, #to_h, #to_json
Constructor Details
This class inherits a constructor from SimpleAcp::Models::Base
Instance Attribute Details
#type ⇒ String (readonly)
Returns await request type.
14 |
# File 'lib/simple_acp/models/await.rb', line 14 attribute :type, required: true |
Class Method Details
.from_hash(hash) ⇒ AwaitRequest?
Parse from hash, creating the appropriate subclass.
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/simple_acp/models/await.rb', line 20 def self.from_hash(hash) return nil if hash.nil? type = hash["type"] || hash[:type] case type when "message" MessageAwaitRequest.from_hash(hash) else super end end |