Package com.tnsai.llm.observability
Interface LLMCallPublisher
- All Known Implementing Classes:
Slf4jLLMCallPublisher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
SPI for publishing Why this exists alongside
LLMCallLog events emitted by
CapturingLLMClient (issue #79).
One publish call per LLM invocation, after the call has completed (success or failure). The publisher MUST NOT throw — observability failures cannot block the agent's hot path. Implementations that need to surface their own errors should log them and swallow.
Why this exists alongside LLMObserver
LLMObserver predates the typed LLMCallLog schema and
works in raw String prompts/responses. It is kept for the
existing ObservableLLMClient wiring (PromptLogger, LLMMetrics).
New consumers — LangFuse / Helicone bridges, Prometheus derivation,
cost dashboards — should target this publisher because the typed
record carries token usage, cost, error info, stream timing, and
full EventContext that the
raw-string observer cannot.- Since:
- 0.9.0 (issue #79)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LLMCallPublisherPublisher that drops every event — the framework default. -
Method Summary
Modifier and TypeMethodDescriptionstatic LLMCallPublishernoOp()ReturnsNOOP.voidpublish(LLMCallLog call) Publish one captured LLM call.
-
Field Details
-
NOOP
Publisher that drops every event — the framework default.
-
-
Method Details
-
publish
Publish one captured LLM call. Must not throw. -
noOp
ReturnsNOOP. Convenience for nullable-publisher call sites.
-