copy

fun copy(environment: AIAgentEnvironment = this.environment, agent: FunctionalAIAgent<*, *> = this.agent, runId: String = this.runId, agentInput: Any? = this.agentInput, config: AIAgentConfig = this.config, llm: AIAgentLLMContext = this.llm, stateManager: AIAgentStateManager = this.stateManager, storage: AIAgentStorage = this.storage, strategyName: String = this.strategyName, pipeline: AIAgentNonGraphPipeline = this.pipeline, parentRootContext: AIAgentContext? = this.parentContext): AIAgentFunctionalContext(source)

Creates a copy of the current AIAgentFunctionalContext, allowing for selective overriding of its properties. This method is particularly useful for creating modified contexts during agent execution without mutating the original context - perfect for when you need to experiment with different configurations or pass tweaked contexts down the execution pipeline while keeping the original pristine!

Return

A shiny new AIAgentFunctionalContext with your desired modifications applied!

Parameters

environment

The AIAgentEnvironment to be used in the new context, or retain the current playground if not specified.

agentId

The unique agent identifier, or keep the same identity if you're feeling attached.

runId

The run identifier for this execution adventure, or stick with the current journey.

agentInput

The input data for the agent - fresh data or the same trusty input, your choice!

config

The AIAgentConfig for the new context, or keep the current rulebook.

llm

The AIAgentLLMContext to be used, or maintain the current AI conversation partner.

stateManager

The AIAgentStateManager to be used, or preserve the current state keeper.

storage

The AIAgentStorage to be used, or stick with the current memory bank.

strategyName

The strategy name, or maintain the current game plan.

pipeline

The AIAgentNonGraphPipeline to be used, or keep the current execution superhighway.

parentRootContext

The parent root context, or maintain the current family tree.