submitToMainDispatcher
Submits a block of code to the main dispatcher for execution.
This method ensures that the given block is executed asynchronously using either AIAgentConfig.strategyExecutorService if configured or Dispatchers.Default otherwise.
Return
The result of the executed block.
Parameters
block
A lambda function that contains the code to be executed asynchronously.
Type Parameters
T
The return type of the block to be executed.