Resolve Trace Hook • AI Agent SDK

resolve_trace_hook: Return “hook“ when a tracer is supplied, else the no-op default.

resolve_trace_hook

Function

</div>

This function is defined in the protocols module.

Return `hook` when a tracer is supplied, else the no-op default.

A tiny helper so a gateway can accept an optional `tracer= argument and always hold a callable hook without branching on None` at every stage.

Diagram

Allow

Deny

Event Trigger

Hook: resolve_trace_hook

Decision

Process

Block

Signature

python
def resolve_trace_hook(hook: 'Optional[GatewayTraceHook]') -> 'GatewayTraceHook'

Parameters

ParamField 'Optional[GatewayTraceHook]'

A user/plugin-supplied trace hook, or `None`.

Returns

ResponseField 'GatewayTraceHook'

data:NULL_GATEWAY_TRACE_HOOK.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 6871


Related Documentation