Class: ActiveAgent::Parameterized::Generation Private

Inherits:
Generation
  • Object
show all
Defined in:
lib/active_agent/concerns/parameterized.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A specialized generation class that handles parameterized agent actions.

This class extends Generation to support passing parameters to agent instances before processing actions. It ensures parameters are properly set both for immediate processing and when enqueuing background jobs.

Direct Known Subclasses

DirectGeneration

Instance Method Summary collapse

Methods inherited from Generation

#actions, #embed_later, #embed_now, #instructions, #message, #messages, #options, #processed?, #prompt_later, #prompt_now, #prompt_now!, #prompt_options, #prompt_preview

Constructor Details

#initialize(agent_class, action, params) ⇒ Generation

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Generation.

Parameters:

  • agent_class (Class)

    the agent class

  • action (Symbol, String)

    the action method name

  • params (Hash)

    the parameters to set on the agent instance

  • args (Array)

    additional arguments for the action method



153
154
155
156
# File 'lib/active_agent/concerns/parameterized.rb', line 153

def initialize(agent_class, action, params, ...)
  super(agent_class, action, ...)
  @params = params
end