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

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

Instance Method Summary collapse

Instance Method Details

#agentObject



54
55
56
# File 'lib/llm/active_record/acts_as_agent.rb', line 54

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

#confirm(*tool_names, &block) ⇒ Object



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

def confirm(*tool_names, &block)
  return agent.confirm if tool_names.empty? && !block
  agent.confirm(*tool_names, &block)
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, &block) ⇒ Object



14
15
16
17
# File 'lib/llm/active_record/acts_as_agent.rb', line 14

def model(model = nil, &block)
  return agent.model if model.nil? && !block
  agent.model(model, &block)
end

#schema(schema = nil, &block) ⇒ Object



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

def schema(schema = nil, &block)
  return agent.schema if schema.nil? && !block
  agent.schema(schema, &block)
end

#skills(*skills, &block) ⇒ Object



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

def skills(*skills, &block)
  return agent.skills if skills.empty? && !block
  agent.skills(*skills, &block)
end

#tools(*tools, &block) ⇒ Object



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

def tools(*tools, &block)
  return agent.tools if tools.empty? && !block
  agent.tools(*tools, &block)
end

#tracer(tracer = nil, &block) ⇒ Object



49
50
51
52
# File 'lib/llm/active_record/acts_as_agent.rb', line 49

def tracer(tracer = nil, &block)
  return agent.tracer if tracer.nil? && !block
  agent.tracer(tracer, &block)
end