What a loop body does with the `toolu_a` reply to the weather question, and what the runner does next.
| 552 | |
| 553 | |
| 554 | class LoopBody(NamedTuple): |
| 555 | """What a loop body does with the `toolu_a` reply to the weather question, and what the runner does next.""" |
| 556 | |
| 557 | reads: Literal["nothing", "reply", "tool_response"] |
| 558 | """What the body reads first. A streamed reply is still unread when the body reads nothing.""" |
| 559 | |
| 560 | change: Change |
| 561 | |
| 562 | conversation: list[BetaMessageParam] |
| 563 | """The conversation the model sees with the next request.""" |
| 564 | |
| 565 | tool_runs: int |
| 566 | |
| 567 | |
| 568 | def _append(*messages: BetaMessageParam) -> Change: |