(depth: int)
| 728 | |
| 729 | # untyped JSON fields (`input_schema`, ...) can nest past the recursion limit |
| 730 | def nested(depth: int) -> object: |
| 731 | data: object = {"type": "base64", "dropped": omit, "data": SAMPLE_FILE_PATH} |
| 732 | for i in range(depth): |
| 733 | data = {"k": data} if i % 2 else (data,) |
| 734 | return data |
| 735 | |
| 736 | depth = 5 * sys.getrecursionlimit() |
| 737 | if isinstance(client, Anthropic): |