The events of `stream_events`, after a `fallback` block: another model serves the rest of the response.
()
| 801 | |
| 802 | |
| 803 | def fallback_stream_events() -> list[dict[str, Any]]: |
| 804 | """The events of `stream_events`, after a `fallback` block: another model serves the rest of the response.""" |
| 805 | fallback = { |
| 806 | "type": "fallback", |
| 807 | "from": {"model": "claude-test"}, |
| 808 | "to": {"model": "claude-fallback"}, |
| 809 | "trigger": {"type": "refusal", "category": None}, |
| 810 | } |
| 811 | start, *rest = stream_events(index=1) |
| 812 | return [ |
| 813 | start, |
| 814 | {"type": "content_block_start", "index": 0, "content_block": fallback}, |
| 815 | {"type": "content_block_stop", "index": 0}, |
| 816 | *rest, |
| 817 | ] |
| 818 | |
| 819 | |
| 820 | def count_accumulated_events(monkeypatch: pytest.MonkeyPatch, *, beta: bool) -> list[str]: |