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

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

Instance Method Summary collapse

Instance Method Details

#agentObject



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

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

#concurrency(concurrency = nil) ⇒ Object



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

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

#instructions(instructions = nil) ⇒ Object



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

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

#model(model = nil) ⇒ Object



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

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

#schema(schema = nil) ⇒ Object



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

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

#tools(*tools) ⇒ Object



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

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