copy
Creates a copy of this LLM context, taking a consistent snapshot of its mutable fields under the internal read lock. Multiple concurrent copy / readSession calls may proceed in parallel, but any concurrent writeSession / withPrompt will serialize against them.
Concurrency caveat: must not be invoked from inside a writeSession or withPrompt on the same context — the underlying lock is not reentrant (see RWLock).
Return
A new instance of AIAgentLLMContext with deep copies of mutable properties.
Creates a non-suspending copy of this LLM context with the given overrides. Unlike the suspending copy overload, this variant does not acquire the internal read lock and therefore does not guarantee a consistent snapshot if another coroutine is concurrently mutating this context.
Return
A new AIAgentLLMContext instance with the specified overrides applied.
Parameters
The list of ToolDescriptor tools to use, or the current tools if not specified.
The Prompt to use, or the current prompt if not specified.
The LLModel to use, or the current model if not specified.
The ResponseProcessor to use, or the current one if not specified.
The PromptExecutor to use, or the current one if not specified.
The AIAgentEnvironment to use, or the current one if not specified.
The AIAgentConfig to use, or the current configuration if not specified.
The Clock to use, or the current clock if not specified.