PolyHedra / src /polyhedra /agents /quant /llm_errors.py
yf176
fix: redact provider credentials from runtime errors
e5fcb2d
Raw History Blame Contribute Delete
365 Bytes
"""Helpers for safe LLM failure messages in quant agent output."""
from __future__ import annotations
from polyhedra.services.error_sanitizer import sanitize_exception
def format_llm_failure(exc: Exception, *, limit: int = 240) -> str:
"""Return a concise, redacted exception detail safe for artifacts/UI."""
return sanitize_exception(exc, limit=limit)