FutureCallbacks
Java-friendly adapters for the engine's callback interfaces.
Every engine callback is an interface with a single suspend fun call(...), which no Java lambda or class can implement. Each factory pairs an engine callback with a CompletableFuture -returning functional interface and awaits it -- the same async idiom as the BaseFuture* SPI bases, with no blocking dispatcher. The sealed CallbackChoice return is built and read via Choices.
Functions
Runs after an agent.
Runs after each model call; may rewrite the response.
Runs after each tool call; may rewrite the result.
Runs before an agent; return Choices.proceed to continue or Choices.breakWith to skip.
Runs before each model call; may rewrite the request or short-circuit with a response.
Runs before each tool call; may rewrite the arguments or short-circuit with a result.
Runs when a model call throws; may swallow the error by returning a response.
Runs when a tool throws; may swallow the error by returning a result.