Class: OllamaAgent::Agent::AgentConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama_agent/agent/agent_config.rb

Overview

Value object grouping Agent construction options (Runner and tests build this explicitly).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model: nil, root: nil, confirm_patches: true, http_timeout: nil, think: nil, read_only: false, patch_policy: nil, system_prompt: nil, skill_paths: nil, skills_enabled: nil, skills_include: nil, skills_exclude: nil, external_skills_enabled: nil, orchestrator: false, confirm_delegation: nil, max_retries: nil, audit: nil, session_id: nil, resume: false, max_tokens: nil, context_summarize: nil, stdin: $stdin, stdout: $stdout, user_prompt: nil, logger: nil, provider: nil, provider_name: nil, budget: nil, permissions: nil, policies: nil, memory_manager: nil, trace_logger: nil, approval_gate: nil) ⇒ AgentConfig

rubocop:disable Metrics/MethodLength, Metrics/ParameterLists, Metrics/AbcSize – value object mirrors Agent keywords

Parameters:

  • confirm_delegation (Boolean, nil) (defaults to: nil)

    nil means default true



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ollama_agent/agent/agent_config.rb', line 18

def initialize(model: nil, root: nil, confirm_patches: true, http_timeout: nil, think: nil,
               read_only: false, patch_policy: nil,
               system_prompt: nil,
               skill_paths: nil, skills_enabled: nil, skills_include: nil, skills_exclude: nil,
               external_skills_enabled: nil,
               orchestrator: false, confirm_delegation: nil,
               max_retries: nil, audit: nil,
               session_id: nil, resume: false,
               max_tokens: nil, context_summarize: nil,
               stdin: $stdin, stdout: $stdout, user_prompt: nil, logger: nil,
               # v2 platform options (all optional — nil keeps existing behaviour)
               provider: nil, provider_name: nil, budget: nil,
               permissions: nil, policies: nil,
               memory_manager: nil, trace_logger: nil, approval_gate: nil)
  @model = model
  @root = root
  @confirm_patches = confirm_patches
  @http_timeout = http_timeout
  @think = think
  @read_only = read_only
  @patch_policy = patch_policy
  @system_prompt = system_prompt
  @skill_paths = skill_paths
  @skills_enabled = skills_enabled
  @skills_include = skills_include
  @skills_exclude = skills_exclude
  @external_skills_enabled = external_skills_enabled
  @orchestrator = orchestrator
  @confirm_delegation = confirm_delegation
  @max_retries = max_retries
  @audit = audit
  @session_id = session_id
  @resume = resume
  @max_tokens = max_tokens
  @context_summarize = context_summarize
  @stdin = stdin
  @stdout = stdout
  @user_prompt = user_prompt
  @logger = logger
  # v2 platform options
  @provider       = provider
  @provider_name  = provider_name
  @budget         = budget
  @permissions    = permissions
  @policies       = policies
  @memory_manager = memory_manager
  @trace_logger   = trace_logger
  @approval_gate  = approval_gate
end

Instance Attribute Details

#approval_gateObject (readonly)

Returns the value of attribute approval_gate.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def approval_gate
  @approval_gate
end

#auditObject (readonly)

Returns the value of attribute audit.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def audit
  @audit
end

#budgetObject (readonly)

Returns the value of attribute budget.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def budget
  @budget
end

#confirm_delegationObject (readonly)

Returns the value of attribute confirm_delegation.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def confirm_delegation
  @confirm_delegation
end

#confirm_patchesObject (readonly)

Returns the value of attribute confirm_patches.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def confirm_patches
  @confirm_patches
end

#context_summarizeObject (readonly)

Returns the value of attribute context_summarize.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def context_summarize
  @context_summarize
end

#external_skills_enabledObject (readonly)

Returns the value of attribute external_skills_enabled.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def external_skills_enabled
  @external_skills_enabled
end

#http_timeoutObject (readonly)

Returns the value of attribute http_timeout.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def http_timeout
  @http_timeout
end

#loggerObject (readonly)

Returns the value of attribute logger.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def logger
  @logger
end

#max_retriesObject (readonly)

Returns the value of attribute max_retries.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def max_retries
  @max_retries
end

#max_tokensObject (readonly)

Returns the value of attribute max_tokens.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def max_tokens
  @max_tokens
end

#memory_managerObject (readonly)

Returns the value of attribute memory_manager.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def memory_manager
  @memory_manager
end

#modelObject (readonly)

Returns the value of attribute model.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def model
  @model
end

#orchestratorObject (readonly)

Returns the value of attribute orchestrator.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def orchestrator
  @orchestrator
end

#patch_policyObject (readonly)

Returns the value of attribute patch_policy.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def patch_policy
  @patch_policy
end

#permissionsObject (readonly)

Returns the value of attribute permissions.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def permissions
  @permissions
end

#policiesObject (readonly)

Returns the value of attribute policies.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def policies
  @policies
end

#providerObject (readonly)

Returns the value of attribute provider.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def provider
  @provider
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def provider_name
  @provider_name
end

#read_onlyObject (readonly)

Returns the value of attribute read_only.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def read_only
  @read_only
end

#resumeObject (readonly)

Returns the value of attribute resume.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def resume
  @resume
end

#rootObject (readonly)

Returns the value of attribute root.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def root
  @root
end

#session_idObject (readonly)

Returns the value of attribute session_id.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def session_id
  @session_id
end

#skill_pathsObject (readonly)

Returns the value of attribute skill_paths.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def skill_paths
  @skill_paths
end

#skills_enabledObject (readonly)

Returns the value of attribute skills_enabled.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def skills_enabled
  @skills_enabled
end

#skills_excludeObject (readonly)

Returns the value of attribute skills_exclude.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def skills_exclude
  @skills_exclude
end

#skills_includeObject (readonly)

Returns the value of attribute skills_include.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def skills_include
  @skills_include
end

#stdinObject (readonly)

Returns the value of attribute stdin.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def stdin
  @stdin
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def stdout
  @stdout
end

#system_promptObject (readonly)

Returns the value of attribute system_prompt.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def system_prompt
  @system_prompt
end

#thinkObject (readonly)

Returns the value of attribute think.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def think
  @think
end

#trace_loggerObject (readonly)

Returns the value of attribute trace_logger.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def trace_logger
  @trace_logger
end

#user_promptObject (readonly)

Returns the value of attribute user_prompt.



7
8
9
# File 'lib/ollama_agent/agent/agent_config.rb', line 7

def user_prompt
  @user_prompt
end

Instance Method Details

#resolved_confirm_delegationObject

rubocop:enable Metrics/MethodLength, Metrics/ParameterLists, Metrics/AbcSize



69
70
71
# File 'lib/ollama_agent/agent/agent_config.rb', line 69

def resolved_confirm_delegation
  @confirm_delegation.nil? || @confirm_delegation
end