EverOS/tests/unit/test_component/test_embedding
zhanghui bd26f5a80f feat(observability): capture LLM + embedding token usage
Surface gen_ai.* model + token attributes onto the active span so Langfuse
can compute cost — without touching everalgo:

- UsageRecordingClient wraps the LLM client and records response.usage after
  each chat(); get_llm_client composes it over the existing _LoggingLLMClient
  only when observability is enabled (disabled default stays overhead-free).
- OpenAIEmbeddingProvider records its response.usage (input tokens) onto the
  active span too.

Tokens land on the everos.extract / everos.reflect.consolidate generation
spans and the search embedding recall; no-op when tracing is off.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 20:47:39 +08:00
..
__init__.py chore: initialize EverOS 1.0.0 2026-06-06 07:33:17 +08:00
test_factory.py chore(release): update EverOS to 1.1.1 (#327) 2026-07-07 18:30:03 +08:00
test_usage_span.py feat(observability): capture LLM + embedding token usage 2026-07-23 20:47:39 +08:00