Build an Anthropic-format error body.
(status_code: int, message: str)
| 542 | # --------------------------------------------------------------------------- |
| 543 | |
| 544 | def anthropic_error_response(status_code: int, message: str) -> dict[str, Any]: |
| 545 | """Build an Anthropic-format error body.""" |
| 546 | return { |
| 547 | "type": "error", |
| 548 | "error": { |
| 549 | "type": _STATUS_TO_ERROR_TYPE.get(status_code, "api_error"), |
| 550 | "message": message, |
| 551 | }, |
| 552 | } |
| 553 | |
| 554 | |
| 555 | # --------------------------------------------------------------------------- |