symfonic.memory._internal.llm.response_parser¶
response_parser ¶
Shared LLM response parsing utilities.
Extracts structured data from LLM text output. Used by both the extraction pipeline and the compaction engine to avoid duplicating the JSON-from-LLM parsing pattern.
extract_json_block ¶
Extract the first JSON object from LLM text output.
Uses a simple brace-matching heuristic: finds the first { and
the last } in content, then attempts json.loads on that
substring.
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
Parsed dict if a valid JSON object is found, otherwise |