MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _is_model_error

Function _is_model_error

uncommon_route/proxy.py:1903–1909  ·  view source on GitHub ↗

Heuristic: does the upstream error body indicate a model-level problem?

(content: bytes)

Source from the content-addressed store, hash-verified

1901
1902
1903def _is_model_error(content: bytes) -> bool:
1904 """Heuristic: does the upstream error body indicate a model-level problem?"""
1905 try:
1906 text = content.decode("utf-8", errors="replace").lower()
1907 return any(p in text for p in _MODEL_ERROR_PATTERNS)
1908 except Exception: # noqa: BLE001
1909 return False
1910
1911
1912def _truncate_diagnostic_text(text: str, limit: int = 240) -> str:

Callers 3

_run_taskMethod · 0.85
_should_try_fallbackFunction · 0.85

Calls

no outgoing calls