Whether a part contributes to the user-facing answer.
(part_type: str, part: dict[str, Any])
| 370 | |
| 371 | |
| 372 | def _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 | |
| 383 | def _merge_text(existing: str, new: str) -> str: |
no test coverage detected