Class: Agentic::AgentConfig
- Inherits:
-
Object
- Object
- Agentic::AgentConfig
- Defined in:
- lib/agentic/agent_config.rb
Overview
Configuration object for an Agent
Instance Attribute Summary collapse
-
#backstory ⇒ String
The backstory or additional context for the agent.
-
#llm_config ⇒ LlmConfig
The LLM configuration for the agent.
-
#name ⇒ String
The name of the agent.
-
#options ⇒ Hash
Additional options for the agent.
-
#role ⇒ String
The role of the agent.
-
#tools ⇒ Array<String>
The tools available to the agent.
Instance Method Summary collapse
-
#initialize(name:, role:, backstory: nil, tools: [], llm_config: nil, options: {}) ⇒ AgentConfig
constructor
Initializes a new agent configuration.
-
#to_h ⇒ Hash
Returns a hash representation of the agent configuration.
Constructor Details
#initialize(name:, role:, backstory: nil, tools: [], llm_config: nil, options: {}) ⇒ AgentConfig
Initializes a new agent configuration
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/agentic/agent_config.rb', line 31 def initialize( name:, role:, backstory: nil, tools: [], llm_config: nil, options: {} ) @name = name @role = role @backstory = backstory @tools = tools @llm_config = llm_config || LlmConfig.new = end |
Instance Attribute Details
#backstory ⇒ String
Returns The backstory or additional context for the agent.
13 14 15 |
# File 'lib/agentic/agent_config.rb', line 13 def backstory @backstory end |
#llm_config ⇒ LlmConfig
Returns The LLM configuration for the agent.
19 20 21 |
# File 'lib/agentic/agent_config.rb', line 19 def llm_config @llm_config end |
#name ⇒ String
Returns The name of the agent.
7 8 9 |
# File 'lib/agentic/agent_config.rb', line 7 def name @name end |
#options ⇒ Hash
Returns Additional options for the agent.
22 23 24 |
# File 'lib/agentic/agent_config.rb', line 22 def end |
#role ⇒ String
Returns The role of the agent.
10 11 12 |
# File 'lib/agentic/agent_config.rb', line 10 def role @role end |
#tools ⇒ Array<String>
Returns The tools available to the agent.
16 17 18 |
# File 'lib/agentic/agent_config.rb', line 16 def tools @tools end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of the agent configuration
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/agentic/agent_config.rb', line 49 def to_h { name: @name, role: @role, backstory: @backstory, tools: @tools, llm_config: { model: @llm_config.model, temperature: @llm_config.temperature }, options: } end |