Interface: GenerationStatsEvent
Defined in: lib/types/dispatch_runner.ts:285
Payload fired on the observability generationStats hook for every record emitted via DispatchExecutorHelpers.reportGenerationStats.
Remarks
The runner enriches the executor-supplied GenerationStats with the active dispatchId and 0-based iteration index (and an emittedAt timestamp) so subscribers can correlate stats across multiple in-flight dispatches without threading extra context — exactly as LogEvent does for the log channel.
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
completionTokens? | number | Tokens in the completion / output (OpenAI usage.completion_tokens, Ollama eval_count). | GenerationStats.completionTokens | lib/types/dispatch_runner.ts:254 |
dispatchId | string | Stable identifier for the dispatch that produced the event. | - | lib/types/dispatch_runner.ts:287 |
emittedAt | DateTime | When the event was emitted. | - | lib/types/dispatch_runner.ts:291 |
evalDurationNs? | number | Time spent generating the response in nanoseconds (Ollama eval_duration). | GenerationStats.evalDurationNs | lib/types/dispatch_runner.ts:264 |
finishReason? | string | Why generation stopped (Ollama done_reason, OpenAI finish_reason). | GenerationStats.finishReason | lib/types/dispatch_runner.ts:266 |
iteration | number | 0-based iteration index within the dispatch. | - | lib/types/dispatch_runner.ts:289 |
loadDurationNs? | number | Time spent loading the model in nanoseconds (Ollama load_duration). | GenerationStats.loadDurationNs | lib/types/dispatch_runner.ts:260 |
model? | string | Model identifier the provider echoed back. | GenerationStats.model | lib/types/dispatch_runner.ts:268 |
promptEvalDurationNs? | number | Time spent evaluating the prompt in nanoseconds (Ollama prompt_eval_duration). | GenerationStats.promptEvalDurationNs | lib/types/dispatch_runner.ts:262 |
promptTokens? | number | Tokens in the prompt / input (OpenAI usage.prompt_tokens, Ollama prompt_eval_count). | GenerationStats.promptTokens | lib/types/dispatch_runner.ts:252 |
provider? | string | Stable provider discriminator (e.g. 'ollama', 'openai_chat_completions'). | GenerationStats.provider | lib/types/dispatch_runner.ts:270 |
raw? | Record<string, unknown> | Full provider-native stats object, verbatim, for forward-compatibility. | GenerationStats.raw | lib/types/dispatch_runner.ts:272 |
totalDurationNs? | number | Total wall-clock generation time in nanoseconds (Ollama total_duration). | GenerationStats.totalDurationNs | lib/types/dispatch_runner.ts:258 |
totalTokens? | number | Total tokens, when the provider reports a combined figure. | GenerationStats.totalTokens | lib/types/dispatch_runner.ts:256 |