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

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

Instance Method Summary collapse

Instance Method Details

#agentObject



60
61
62
# File 'lib/llm/active_record/acts_as_agent.rb', line 60

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

#tools(*tools, &block) ⇒ Object



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

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

#skills(*skills, &block) ⇒ Object



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

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

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



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

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

#instructions(instructions = nil) ⇒ Object



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

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

#concurrency(concurrency = nil) ⇒ Object



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

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

#confirm(*tool_names, &block) ⇒ Object



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

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

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



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

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

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



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

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