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

Function _strip_wrapper_prefix

uncommon_route/proxy.py:389–401  ·  view source on GitHub ↗
(text: str)

Source from the content-addressed store, hash-verified

387
388
389def _strip_wrapper_prefix(text: str) -> str:
390 remaining = text.strip()
391 while remaining:
392 match = _WRAPPER_BLOCK_RE.match(remaining)
393 if not match:
394 break
395 block = match.group(0).strip()
396 if not _looks_like_wrapper_text(block):
397 break
398 remaining = remaining[match.end():].lstrip()
399 if _looks_like_wrapper_text(remaining):
400 return ""
401 return remaining.strip()
402
403
404def _extract_current_message(text: str) -> str | None:

Callers 1

Calls 1

_looks_like_wrapper_textFunction · 0.85

Tested by

no test coverage detected