Module: ActiveAgent::Parameterized

Extended by:
ActiveSupport::Concern
Included in:
Base
Defined in:
lib/active_agent/concerns/parameterized.rb

Overview

Provides parameterization support for agents, allowing you to pass variables to agent actions that can be used in templates.

When included in an agent class, this concern enables the ability to pass parameters when calling agent actions, making agents reusable with different data contexts.

Examples:

Basic usage

class WelcomeAgent < ActiveAgent::Base
  def greet
    # Template can access params[:user_name]
  end
end

# Pass parameters to the agent action
WelcomeAgent.with(user_name: "Alice").greet.generate

Using in templates

# In greet.txt.erb template:
# Hello <%= params[:user_name] %>!

Multiple parameters

OrderAgent.with(order_id: 123, customer: "John").process_order.generate

Defined Under Namespace

Classes: Agent, DirectGeneration, Generation