Skip to main content

Function: fireLlmUsageObserver()

fireLlmUsageObserver(event, account?): void

Defined in: packages/agentos/src/api/observers.ts:302

Internal

Internal dispatcher called by every agentos LLM-resolving surface (generateText/generateObject/etc.) immediately before returning to the caller. Fire-and-forget — errors thrown by the host observer are caught + logged to stderr so a misbehaving observer can never crash the LLM call path.

No-op when no observer is registered, and while content-safe telemetry is on.

Parameters​

event​

LlmUsageEvent

The event. An accountId set on it stays.

account?​

LlmUsageAccountSource

Where the event reads its account when it carries none: read only here, past the no-op checks, so a host's accountIdOf is not asked for an event nothing will hear.

Returns​

void