Skip to main content

trace_context

Function
This function is defined in the context_events module.
Context manager for trace emitter lifecycle. Automatically sets the emitter on entry and resets on exit, even if an exception occurs. This is the recommended way to use custom trace emitters.

Signature

Parameters

ContextTraceEmitter
required
The emitter to use within the context. The emitter for use within the context.

Returns

Generator['ContextTraceEmitter', None, None]
The result of the operation.

Usage

Uses

  • set_context_emitter
  • reset_context_emitter

Source

View on GitHub

praisonaiagents/trace/context_events.py at line 88

Context Concept

Context Management

Context Strategies