Call `send()`, `parse()` or `stream()`, and read a stream to its end.
(
thread: BetaAsyncMessageThread[Any], method: str, *messages: BetaMessageParam, **overrides: Any
)
| 1850 | |
| 1851 | |
| 1852 | async def run_turn( |
| 1853 | thread: BetaAsyncMessageThread[Any], method: str, *messages: BetaMessageParam, **overrides: Any |
| 1854 | ) -> None: |
| 1855 | """Call `send()`, `parse()` or `stream()`, and read a stream to its end.""" |
| 1856 | turn = getattr(thread, method)(*messages, **overrides) |
| 1857 | if method == "stream": |
| 1858 | async with turn as stream: |
| 1859 | await stream.until_done() |
| 1860 | else: |
| 1861 | await turn |
no test coverage detected