|
1 | 1 | from fastapi import FastAPI, Request, status, HTTPException |
2 | 2 | from fastapi.responses import JSONResponse |
| 3 | +from fastapi.security import APIKeyHeader |
3 | 4 | import logging |
4 | 5 | import os |
5 | 6 |
|
6 | 7 | from .general import router as general_router |
| 8 | +from .openapi import set_custom_openapi |
7 | 9 |
|
8 | 10 | logger = logging.getLogger("unstructured_api") |
9 | 11 |
|
10 | | - |
11 | 12 | app = FastAPI( |
12 | 13 | title="Unstructured Pipeline API", |
13 | | - description="""""", |
14 | | - version="0.0.63", |
| 14 | + summary="Partition documents with the Unstructured library", |
| 15 | + version="0.0.64", |
15 | 16 | docs_url="/general/docs", |
16 | 17 | openapi_url="/general/openapi.json", |
| 18 | + servers=[ |
| 19 | + { |
| 20 | + "url": "https://api.unstructured.io", |
| 21 | + "description": "Hosted API", |
| 22 | + "x-speakeasy-server-id": "prod", |
| 23 | + }, |
| 24 | + { |
| 25 | + "url": "http://localhost:8000", |
| 26 | + "description": "Development server", |
| 27 | + "x-speakeasy-server-id": "local", |
| 28 | + }, |
| 29 | + ], |
| 30 | + openapi_tags=[{"name": "general"}], |
17 | 31 | ) |
18 | 32 |
|
19 | 33 | # Note(austin) - This logger just dumps exceptions |
@@ -49,6 +63,8 @@ async def error_handler(request: Request, e: Exception): |
49 | 63 |
|
50 | 64 | app.include_router(general_router) |
51 | 65 |
|
| 66 | +set_custom_openapi(app) |
| 67 | + |
52 | 68 |
|
53 | 69 | # Filter out /healthcheck noise |
54 | 70 | class HealthCheckFilter(logging.Filter): |
|
0 commit comments