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

Link copied to clipboard

Runs after an agent.

Link copied to clipboard

Runs after each model call; may rewrite the response.

Link copied to clipboard

Runs after each tool call; may rewrite the result.

Link copied to clipboard

Runs before an agent; return Choices.proceed to continue or Choices.breakWith to skip.

Link copied to clipboard

Runs before each model call; may rewrite the request or short-circuit with a response.

Link copied to clipboard

Runs before each tool call; may rewrite the arguments or short-circuit with a result.

Link copied to clipboard

Runs when a model call throws; may swallow the error by returning a response.

Link copied to clipboard

Runs when a tool throws; may swallow the error by returning a result.