interceptEnvironmentCreated

Intercepts environment creation to allow features to modify or enhance the agent environment.

This method registers a transformer function that will be called when an agent environment is being created, allowing the feature to customize the environment based on the agent context.

Parameters

context

The context of the feature being intercepted, providing access to the feature key and implementation

transform

A function that transforms the environment, with access to the agent creation context

Example:

pipeline.interceptEnvironmentCreated(InterceptContext) { environment ->
// Modify the environment based on agent context
environment.copy(
variables = environment.variables + mapOf("customVar" to "value")
)
}