with

inline fun <T> AIAgentContext.with(executionInfo: AgentExecutionInfo, block: (executionInfo: AgentExecutionInfo, eventId: String) -> T): T(source)

Executes a block of code with a modified execution context.

Return

The result of executing the provided block.

Parameters

T

The return type of the block being executed.

executionInfo

The execution info to be set for the context.

block

The suspend function to execute with the modified execution context.


inline fun <T> AIAgentContext.with(partName: String, block: (executionInfo: AgentExecutionInfo, eventId: String) -> T): T(source)

Executes a block of code with a modified execution context, creating a parent-child relationship between execution contexts for tracing purposes.

Return

The result of executing the provided block.

Parameters

T

The return type of the block being executed.

partName

The name of the execution part to append to the execution path.

block

The suspend function to execute with the modified execution context.