Class: Ghostest::Config::Agent
- Inherits:
-
Object
- Object
- Ghostest::Config::Agent
- Includes:
- AttrReader
- Defined in:
- lib/ghostest/config/agent.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#occupation ⇒ Object
readonly
Returns the value of attribute occupation.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#system_prompt ⇒ Object
readonly
Returns the value of attribute system_prompt.
Instance Method Summary collapse
-
#initialize(name, hash, global_config) ⇒ Agent
constructor
A new instance of Agent.
- #role_klass ⇒ Object
Constructor Details
#initialize(name, hash, global_config) ⇒ Agent
Returns a new instance of Agent.
8 9 10 11 12 13 14 15 |
# File 'lib/ghostest/config/agent.rb', line 8 def initialize(name, hash, global_config) @global_config = global_config @name = name @role = hash[:role] || raise(ConfigError.new("Agent role is required")) @system_prompt = hash[:system_prompt] || raise(ConfigError.new("Agent system_prompt is required")) @color = hash[:color] || raise(ConfigError.new("Agent color is required")) end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
6 7 8 |
# File 'lib/ghostest/config/agent.rb', line 6 def color @color end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ghostest/config/agent.rb', line 6 def name @name end |
#occupation ⇒ Object (readonly)
Returns the value of attribute occupation.
6 7 8 |
# File 'lib/ghostest/config/agent.rb', line 6 def occupation @occupation end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
6 7 8 |
# File 'lib/ghostest/config/agent.rb', line 6 def role @role end |
#system_prompt ⇒ Object (readonly)
Returns the value of attribute system_prompt.
6 7 8 |
# File 'lib/ghostest/config/agent.rb', line 6 def system_prompt @system_prompt end |
Instance Method Details
#role_klass ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ghostest/config/agent.rb', line 17 def role_klass case @role.to_sym when :test_designer return Llm::Agents::TestDesigner when :test_programmer return Llm::Agents::TestProgrammer when :reviewer return Llm::Agents::Reviewer else raise ConfigError.new("Unknown agent role #{@role}") end end |