Skip to content
1 min read · 278 words

Type Alias: DispatchRunnerObservabilityHooks

ts
type DispatchRunnerObservabilityHooks = {
  dispatchEnd: [[DispatchEndEvent], []];
  dispatchStart: [[DispatchStartEvent], []];
  error: [[BaseException], []];
  generationStats: [[GenerationStatsEvent], []];
  iterationEnd: [[IterationEndEvent], []];
  iterationStart: [[IterationStartEvent], []];
  log: [[LogEvent], []];
  toolExecutionEnd: [[ToolExecutionEndEvent], []];
  toolExecutionStart: [[ToolExecutionStartEvent], []];
  warning: [[WarningEvent], []];
};

Defined in: src/lib/types/dispatch_runner.ts:468

Observability hook events on @nhtio/adk!DispatchRunner.

Remarks

Instrumentation-only events. Register handlers via the observers field of the dispatch input. Removing an observer does not affect dispatch correctness.

Properties

PropertyTypeDescriptionDefined in
dispatchEnd[[DispatchEndEvent], []]Fired once when the dispatch ends (ack / nack / aborted).src/lib/types/dispatch_runner.ts:480
dispatchStart[[DispatchStartEvent], []]Fired once when the dispatch begins.src/lib/types/dispatch_runner.ts:478
error[[BaseException], []]Fired when a non-fatal pipeline or executor error occurs. The exception is also re-thrown.src/lib/types/dispatch_runner.ts:482
generationStats[[GenerationStatsEvent], []]Fired for every generation-stats record emitted via DispatchExecutorHelpers.reportGenerationStats.src/lib/types/dispatch_runner.ts:489
iterationEnd[[IterationEndEvent], []]Fired at the end of each iteration.src/lib/types/dispatch_runner.ts:476
iterationStart[[IterationStartEvent], []]Fired at the start of each iteration.src/lib/types/dispatch_runner.ts:474
log[[LogEvent], []]Fired for every structured log event emitted by the executor via DispatchExecutorHelpers.log.src/lib/types/dispatch_runner.ts:484
toolExecutionEnd[[ToolExecutionEndEvent], []]Forwarded from the context after a tool handler returns or throws.src/lib/types/dispatch_runner.ts:472
toolExecutionStart[[ToolExecutionStartEvent], []]Forwarded from the context immediately before a tool handler is called.src/lib/types/dispatch_runner.ts:470
warning[[WarningEvent], []]Fired for a non-fatal degradation the dispatch recovered from (e.g. token-estimation fell back to a char guesstimate). Does NOT end the dispatch — distinct from error.src/lib/types/dispatch_runner.ts:487