Assert that `request`, which follows the `toolu_a` reply `msg_a` to the weather question, shows the model `conversation`. With default settings it leaves out the question and the reply when `conversation` starts with them, and sends all of any other.
(
request: dict[str, Any], mode: dict[str, Any], conversation: list[BetaMessageParam]
)
| 650 | |
| 651 | |
| 652 | def assert_sends_conversation( |
| 653 | request: dict[str, Any], mode: dict[str, Any], conversation: list[BetaMessageParam] |
| 654 | ) -> None: |
| 655 | """Assert that `request`, which follows the `toolu_a` reply `msg_a` to the weather question, shows the model |
| 656 | `conversation`. With default settings it leaves out the question and the reply when `conversation` starts with |
| 657 | them, and sends all of any other.""" |
| 658 | if mode: |
| 659 | assert "thread" not in request |
| 660 | assert request["messages"] == conversation |
| 661 | elif conversation[:2] == [WEATHER_QUESTION, tool_use("toolu_a")]: |
| 662 | assert request["thread"] == continue_from("msg_a") |
| 663 | assert request["messages"] == conversation[2:] |
| 664 | else: |
| 665 | assert request["thread"] == CREATE |
| 666 | assert request["messages"] == conversation |
| 667 | |
| 668 | |
| 669 | def two_tool_uses_response(id: str) -> httpx2.Response: |