call

abstract suspend fun call(context: CallbackContext, response: LlmResponse): LlmResponse

Callback executed after a response is received from the model.

This is the ideal place to log model responses, collect metrics on token usage, or perform post-processing on the raw LlmResponse.

Return

The potentially updated or replaced LlmResponse to propagate down the chain.

Parameters

context

The context of the current agent call.

response

The response object received from the model.