withPersistency
suspend fun <T> AIAgentContextBase.withPersistency(context: AIAgentContextBase, action: suspend Persistency.(AIAgentContextBase) -> T): T(source)
Extension function to perform an action with the checkpoint feature.
This is a convenience function that retrieves the checkpoint feature and executes the provided action with it.
Return
The result of the action
Parameters
T
The return type of the action
context
The agent context to pass to the action
action
The action to perform with the checkpoint feature