(self)
| 1120 | self._worker.start() |
| 1121 | |
| 1122 | def _run_worker(self) -> None: |
| 1123 | while not self._stop.is_set(): |
| 1124 | item = self._inbox.get() |
| 1125 | if item is _SHUTDOWN or self._stop.is_set(): |
| 1126 | break |
| 1127 | if isinstance(item, dict) and item.get("__btw__"): # side question (/btw) |
| 1128 | self._run_turn(item.get("content"), btw=True) |
| 1129 | continue |
| 1130 | if not isinstance(item, (str, list)): # str prompt, or multimodal blocks |
| 1131 | continue |
| 1132 | self._run_turn(item) |
| 1133 | self._close_stream() |
| 1134 | |
| 1135 | def _run_turn(self, prompt, btw: bool = False) -> None: # prompt: str | list[ContentBlock] |
| 1136 | # btw=True → a "side question" (the original's /btw): run with full context |
nothing calls this directly
no test coverage detected