withPrompt

suspend fun withPrompt(block: Prompt.() -> Prompt): AIAgentLLMContext(source)

Updates the current AIAgentLLMContext with a new prompt and ensures thread-safe access using a read lock.

Return

The current instance of AIAgentLLMContext with the updated prompt.

Parameters

prompt

The new Prompt to be set for the context.