Class: Agentic::AgentSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/agentic/agent_specification.rb

Overview

Value object representing requirements for an agent

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#descriptionString (readonly)



10
11
12
# File 'lib/agentic/agent_specification.rb', line 10

def description
  @description
end

#instructionsString (readonly)



13
14
15
# File 'lib/agentic/agent_specification.rb', line 13

def instructions
  @instructions
end

#nameString (readonly)



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_hHash

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