Class: Agentic::AgentSpecification
- Inherits:
-
Object
- Object
- Agentic::AgentSpecification
- Defined in:
- lib/agentic/agent_specification.rb
Overview
Value object representing requirements for an agent
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
A description of the agent.
-
#instructions ⇒ String
readonly
Instructions for the agent.
-
#name ⇒ String
readonly
The name of the agent.
Class Method Summary collapse
-
.from_hash(hash) ⇒ AgentSpecification
Creates an AgentSpecification from a hash.
Instance Method Summary collapse
-
#initialize(name:, description:, instructions:) ⇒ AgentSpecification
constructor
Initializes a new agent specification.
-
#to_h ⇒ Hash
Returns a serializable representation of the agent specification.
Constructor Details
#initialize(name:, description:, instructions:) ⇒ AgentSpecification
Initializes a new agent specification
19 20 21 22 23 |
# File 'lib/agentic/agent_specification.rb', line 19 def initialize(name:, description:, instructions:) @name = name @description = description @instructions = instructions end |
Instance Attribute Details
#description ⇒ String (readonly)
Returns A description of the agent.
10 11 12 |
# File 'lib/agentic/agent_specification.rb', line 10 def description @description end |
#instructions ⇒ String (readonly)
Returns Instructions for the agent.
13 14 15 |
# File 'lib/agentic/agent_specification.rb', line 13 def instructions @instructions end |
#name ⇒ String (readonly)
Returns The name of the agent.
7 8 9 |
# File 'lib/agentic/agent_specification.rb', line 7 def name @name end |
Class Method Details
.from_hash(hash) ⇒ AgentSpecification
Creates an AgentSpecification from a hash
38 39 40 41 42 43 44 |
# File 'lib/agentic/agent_specification.rb', line 38 def self.from_hash(hash) new( name: hash["name"], description: hash["description"], instructions: hash["instructions"] ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a serializable representation of the agent specification
27 28 29 30 31 32 33 |
# File 'lib/agentic/agent_specification.rb', line 27 def to_h { "name" => @name, "description" => @description, "instructions" => @instructions } end |