writeSession
Executes a block of code within a write session for the AI Agent LLM context.
This function provides a mechanism to modify or interact with the AI Agent's state in a mutable manner, ensuring proper synchronization and execution within the main dispatcher.
Return
The result produced by the provided block of code.
Parameters
block
A function that takes an instance of AIAgentLLMWriteSession as its receiver and performs operations on it. The result of this block is the return value of the enclosing function.
Type Parameters
T
The return type of the operation performed within the write session.