(
attachment_id: str,
_auth: AuthContext = Depends(require_file_scope),
service: ChatService = Depends(get_chat_service),
)
| 92 | @router.get("/files/{attachment_id}") |
| 93 | @router.get("/files/{attachment_id}/content") |
| 94 | async def get_file( |
| 95 | attachment_id: str, |
| 96 | _auth: AuthContext = Depends(require_file_scope), |
| 97 | service: ChatService = Depends(get_chat_service), |
| 98 | ): |
| 99 | result = await _run_file(lambda: service.resolve_attachment_file(attachment_id)) |
| 100 | if isinstance(result, dict) and result.get("status") == "error": |
| 101 | return result |
| 102 | file_path, mimetype = result |
| 103 | return _file_response(file_path, mimetype) |
| 104 | |
| 105 | |
| 106 | @router.delete("/files/{attachment_id}") |
nothing calls this directly
no test coverage detected