copy

fun copy(environment: AIAgentEnvironment = this.environment, agentId: String = this.agentId, 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: AIAgentFunctionalPipeline = this.pipeline, executionInfo: AgentExecutionInfo = this.executionInfo, parentRootContext: AIAgentContext? = this.parentContext): AIAgentFunctionalContext(source)

Creates a copy of the current AIAgentFunctionalContext, allowing for selective overriding of its properties. This method is useful for creating modified contexts during agent execution without mutating the original context.

Return

A new AIAgentFunctionalContext with the specified modifications applied.

Parameters

environment

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

agentId

The unique agent identifier, or the current one if not specified.

runId

The run identifier, or the current run ID if not specified.

agentInput

The input data for the agent, or the current input if not specified.

config

The AIAgentConfig for the new context, or the current configuration if not specified.

llm

The AIAgentLLMContext to be used, or the current LLM context if not specified.

stateManager

The AIAgentStateManager to be used, or the current state manager if not specified.

storage

The AIAgentStorage to be used, or the current storage if not specified.

strategyName

The strategy name, or the current strategy name if not specified.

pipeline

The AIAgentFunctionalPipeline to be used, or the current pipeline if not specified.

executionInfo

The AgentExecutionInfo to be used, or the current execution info if not specified.

parentRootContext

The parent context, or the current parent context if not specified.