Module: LLM::ActiveRecord::ActsAsAgent::ClassMethods

Defined in:
lib/llm/active_record/acts_as_agent.rb

Instance Method Summary collapse

Instance Method Details

#agentObject



44
45
46
# File 'lib/llm/active_record/acts_as_agent.rb', line 44

def agent
  @agent ||= Class.new(LLM::Agent)
end

#concurrency(concurrency = nil) ⇒ Object



39
40
41
42
# File 'lib/llm/active_record/acts_as_agent.rb', line 39

def concurrency(concurrency = nil)
  return agent.concurrency if concurrency.nil?
  agent.concurrency(concurrency)
end

#instructions(instructions = nil) ⇒ Object



34
35
36
37
# File 'lib/llm/active_record/acts_as_agent.rb', line 34

def instructions(instructions = nil)
  return agent.instructions if instructions.nil?
  agent.instructions(instructions)
end

#model(model = nil) ⇒ Object



19
20
21
22
# File 'lib/llm/active_record/acts_as_agent.rb', line 19

def model(model = nil)
  return agent.model if model.nil?
  agent.model(model)
end

#schema(schema = nil) ⇒ Object



29
30
31
32
# File 'lib/llm/active_record/acts_as_agent.rb', line 29

def schema(schema = nil)
  return agent.schema if schema.nil?
  agent.schema(schema)
end

#tools(*tools) ⇒ Object



24
25
26
27
# File 'lib/llm/active_record/acts_as_agent.rb', line 24

def tools(*tools)
  return agent.tools if tools.empty?
  agent.tools(*tools)
end