Class: Agentic::TaskDefinition
- Inherits:
-
Object
- Object
- Agentic::TaskDefinition
- Defined in:
- lib/agentic/task_definition.rb
Overview
Value object representing a task definition
Instance Attribute Summary collapse
-
#agent ⇒ AgentSpecification
readonly
The agent specification for this task.
-
#description ⇒ String
readonly
A description of the task.
Class Method Summary collapse
-
.from_hash(hash) ⇒ TaskDefinition
Creates a TaskDefinition from a hash.
Instance Method Summary collapse
-
#initialize(description:, agent:) ⇒ TaskDefinition
constructor
Initializes a new task definition.
-
#to_h ⇒ Hash
Returns a serializable representation of the task definition.
Constructor Details
#initialize(description:, agent:) ⇒ TaskDefinition
Initializes a new task definition
15 16 17 18 |
# File 'lib/agentic/task_definition.rb', line 15 def initialize(description:, agent:) @description = description @agent = agent end |
Instance Attribute Details
#agent ⇒ AgentSpecification (readonly)
Returns The agent specification for this task.
10 11 12 |
# File 'lib/agentic/task_definition.rb', line 10 def agent @agent end |
#description ⇒ String (readonly)
Returns A description of the task.
7 8 9 |
# File 'lib/agentic/task_definition.rb', line 7 def description @description end |
Class Method Details
.from_hash(hash) ⇒ TaskDefinition
Creates a TaskDefinition from a hash
32 33 34 35 36 37 |
# File 'lib/agentic/task_definition.rb', line 32 def self.from_hash(hash) new( description: hash["description"], agent: AgentSpecification.from_hash(hash["agent"]) ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a serializable representation of the task definition
22 23 24 25 26 27 |
# File 'lib/agentic/task_definition.rb', line 22 def to_h { "description" => @description, "agent" => @agent.to_h } end |