Skip to main content

Module util

Module util 

Source
Expand description

Shared utility functions for agent services

Structs§

CognitionSnapshot

Functions§

extract_agent_summary
Extract the agent.summary field from JSON metadata, falling back to a truncated content excerpt.
flush_metric_samples
maybe_embed
Attempt to generate an embedding for content using 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