handle
inline fun <I : Any, O> AgentCoreRuntimeConfig.handle(crossinline handler: TypedInvocationHandler<I, O>)(source)
Registers a typed invocation handler — convenience for JSON-in / JSON-out flows.
When set, the unified AgentCoreRuntimeConfig.handler is ignored. Requires ContentNegotiation (e.g. json()) to be installed on the application.
Example:
routing {
agentCoreRuntime {
handle<MyRequest, MyResponse> { input, ctx ->
MyResponse(answer = process(input.prompt))
}
}
}Content copied to clipboard