Class NoopTrace

java.lang.Object
ai.acolite.agentsdk.core.tracing.Trace
ai.acolite.agentsdk.core.tracing.NoopTrace

public class NoopTrace extends Trace
No-op trace that does nothing.

Used when tracing is disabled. All lifecycle methods are no-ops. Extends Trace to maintain type compatibility. Singleton pattern for efficiency.

Ported from TypeScript OpenAI Agents SDK Source: tracing/traces.ts

  • Field Details

    • INSTANCE

      public static final NoopTrace INSTANCE
      Singleton instance
  • Method Details

    • start

      public void start()
      Description copied from class: Trace
      Start the trace. Calls processor.onTraceStart(). Idempotent - multiple calls are safe.
      Overrides:
      start in class Trace
    • end

      public void end()
      Description copied from class: Trace
      End the trace. Calls processor.onTraceEnd(). Idempotent - multiple calls are safe.
      Overrides:
      end in class Trace
    • clone

      public NoopTrace clone()
      Description copied from class: Trace
      Clone this trace with same properties. Useful for creating related traces with shared configuration.
      Overrides:
      clone in class Trace
    • toJson

      public Map<String,Object> toJson(boolean includeTracingApiKey)
      Description copied from class: Trace
      Convert to JSON for export.
      Overrides:
      toJson in class Trace
      Parameters:
      includeTracingApiKey - Whether to include API key in output
      Returns:
      JSON representation
    • toJson

      public Map<String,Object> toJson()
      Description copied from class: Trace
      Convert to JSON (excludes API key by default for security)
      Overrides:
      toJson in class Trace