MCPcopy Index your code
hub / github.com/IBM/AssetOpsBench / _visible_text

Function _visible_text

src/agent/opencode_agent/runner.py:364–369  ·  view source on GitHub ↗

Remove optional model thinking markup from user-facing text.

(text: str)

Source from the content-addressed store, hash-verified

362
363
364def _visible_text(text: str) -> str:
365 """Remove optional model thinking markup from user-facing text."""
366 text = _THINK_BLOCK_RE.sub("", text)
367 if "</think>" in text.lower() and "<think>" not in text.lower():
368 text = re.split(r"</think>", text, flags=re.IGNORECASE)[-1]
369 return re.sub(r"</?think>", "", text, flags=re.IGNORECASE).strip()
370
371
372def _is_answer_text(part_type: str, part: dict[str, Any]) -> bool:

Callers 2

_final_answerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected