77import mimetypes
88import os
99import secrets
10- import zipfile
1110from base64 import b64encode
1211from concurrent .futures import ThreadPoolExecutor
1312from functools import partial
14- from types import TracebackType
1513from typing import IO , Any , Dict , List , Mapping , Optional , Sequence , Tuple , Union , cast
1614
1715import backoff
3331from starlette .datastructures import Headers
3432from starlette .types import Send
3533
36- from prepline_general .api .models .form_params import GeneralFormParams
3734from prepline_general .api .filetypes import get_validated_mimetype
35+ from prepline_general .api .models .form_params import GeneralFormParams
3836from unstructured .documents .elements import Element
3937from unstructured .partition .auto import partition
4038from unstructured .staging .base import (
@@ -53,7 +51,9 @@ def is_compatible_response_type(media_type: str, response_type: type) -> bool:
5351 return (
5452 False
5553 if media_type == "application/json" and response_type not in [dict , list ]
56- else False if media_type == "text/csv" and response_type != str else True
54+ else False
55+ if media_type == "text/csv" and response_type != str
56+ else True
5757 )
5858
5959
@@ -602,7 +602,7 @@ def return_content_type(filename: str):
602602
603603
604604@router .get ("/general/v0/general" , include_in_schema = False )
605- @router .get ("/general/v0.0.84 /general" , include_in_schema = False )
605+ @router .get ("/general/v0.0.85 /general" , include_in_schema = False )
606606async def handle_invalid_get_request ():
607607 raise HTTPException (
608608 status_code = status .HTTP_405_METHOD_NOT_ALLOWED , detail = "Only POST requests are supported."
@@ -617,7 +617,7 @@ async def handle_invalid_get_request():
617617 description = "Description" ,
618618 operation_id = "partition_parameters" ,
619619)
620- @router .post ("/general/v0.0.84 /general" , include_in_schema = False )
620+ @router .post ("/general/v0.0.85 /general" , include_in_schema = False )
621621def general_partition (
622622 request : Request ,
623623 # cannot use annotated type here because of a bug described here:
0 commit comments