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

Function _is_answer_text

src/agent/opencode_agent/runner.py:372–380  ·  view source on GitHub ↗

Whether a part contributes to the user-facing answer.

(part_type: str, part: dict[str, Any])

Source from the content-addressed store, hash-verified

370
371
372def _is_answer_text(part_type: str, part: dict[str, Any]) -> bool:
373 """Whether a part contributes to the user-facing answer."""
374 if any(hint in part_type for hint in _REASONING_HINTS):
375 return False
376 if "text" in part_type:
377 return True
378 if not part_type and part.get("role") == "assistant":
379 return True
380 return False
381
382
383def _merge_text(existing: str, new: str) -> str:

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected