AgentToolHooksMixin#

Build extensions, choose hooks, and manage request-scoped state. See the guide.

class zett_agent.extensions.base.AgentToolHooksMixin[源代码]#

Hooks immediately before and after each requested tool invocation.

async before_tool(context, call)[源代码]#

Run before one requested tool is invoked.

参数:
返回类型:

None

async after_tool(context, call, result, error)[源代码]#

Inspect or modify a tool result before it is appended.

error is the original execution exception for a failed result and None after successful execution. Changes made to result are included in context, persistence, and the next model request. Raising prevents the result from being appended.

参数:
返回类型:

None