Skip to main content

Returns

This method returns None.

Example

clear_context(trace_context)

Parameters

token
object
required
The context token returned by set_context().
flush
bool
If True (default), export any pending traces associated with the current inference result to the telemetry exporter before detaching the context.
Always use clear_context() in a finally block to ensure proper cleanup, even if an exception occurs.