Module: LLM::ActiveRecord::ActsAsAgent::InstanceMethods

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

Instance Method Summary collapse

Instance Method Details

#llmLLM::Provider

Returns the resolved provider instance for this record.

Returns:



70
71
72
73
74
75
76
# File 'lib/llm/active_record/acts_as_agent.rb', line 70

def llm
  options = self.class.llm_plugin_options
  return @llm if @llm
  @llm = Utils.resolve_provider(self, options, EMPTY_HASH)
  @llm.tracer = Utils.resolve_option(self, options[:tracer]) if options[:tracer]
  @llm
end

#repl(**params) ⇒ void

Note:

This method does not persist to the database, but it can inspect and alter runtime state in a way that is temporary.

This method returns an undefined value.

Parameters:

  • tracer (Boolean)

    When true, the tracer is kept alive during the repl session. Default is false.

  • tools (Array<LLM::Tool>)

    Extra tools to attach for the repl session

  • skills (Array<String>)

    Extra skills to attach for the repl session



85
86
87
# File 'lib/llm/active_record/acts_as_agent.rb', line 85

def repl(**params)
  ctx.repl(**params)
end