Set Context Emitter • AI Agent SDK
set_context_emitter: Set the context trace emitter for the current async context.
set_context_emitter
Function
</div>
This function is defined in the context_events module.
Set the context trace emitter for the current async context.
Signature
def set_context_emitter(emitter: 'ContextTraceEmitter') -> contextvars.TokenParameters
ParamField
ContextTraceEmitterThe emitter to set as current.
Returns
ResponseField
contextvars.TokenToken that can be used with reset_context_emitter() to restore previous state.
Used By
Source
View on GitHubpraisonaiagents/trace/context_events.py at line 98