interceptAgentBeforeClose

fun interceptAgentBeforeClose(feature: AIAgentFeature<*, *>, handle: suspend (AgentClosingContext) -> Unit)(source)

Deprecated

Please use interceptAgentClosing instead. This method is deprecated and will be removed in the next release.

Replace with

import ai.koog.agents.core.feature.handler.agent.AgentClosingContext
interceptAgentClosing(feature, handle)

Intercepts and sets a handler to be invoked before an agent is closed.