Returns
Returns a context token that must be passed toclear_context() for cleanup.
Example
Parameters
The inference result ID to associate traces with. All subsequent traces will be linked to this ID.
How It Works
When you callset_context(), it attaches the provided ID to the current OpenTelemetry context. Any traces created by @trace decorated functions or start_trace() will automatically include this ID as an attribute, enabling:
- Trace Correlation - All traces are linked to the same inference result
- Automatic Export - Traces are batched and exported to Galtea API