Expand description
Shared utility functions for agent services
Structs§
Functions§
- extract_
agent_ summary - Extract the
agent.summaryfield from JSON metadata, falling back to a truncated content excerpt. - flush_
metric_ samples - maybe_
embed - Attempt to generate an embedding for
contentusing the optional service. - parse_
json_ response - Parse a JSON response using the same fenced-block tolerance as
LlmClientJson. - record_
stage_ metric - Persist a best-effort stage timing metric without impacting cognition flow.
- record_
token_ usage_ metrics - Persist best-effort token usage metrics for a cognition stage.
- stage_
metric_ sample - token_
usage_ metric_ samples