You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I provide a value for my file's content type to the partitioning API?
I noticed that the code in unstructured-api determines how to partition each file using the content_type attribute attached to the FastAPI UploadFile. If one is not provided, it tries to infer the file type using the filename extension.
My file names are arbitrary UUIDs (no filename extension) so when I try to partition them I get this error
{"detail":"File type None is not supported."}
I would like to manually provide a value for UploadFile.content_type to avoid the fallback behavior but I don't see a way to do that using the JS client. Can we modify the Files definition to include an optional value for contentType, which I presume would be used in the unstructured-api code and result in skipping the fallback path?
export declare class Files extends SpeakeasyBase {
content: Uint8Array;
fileName: string;
// PROPOSING WE ADD THE FOLLOWING LINE
contentType?: string;
}
The text was updated successfully, but these errors were encountered:
omikader
changed the title
Should contentType be an optional parameter?
How do I supply FIles.contentType?
Jan 29, 2024
omikader
changed the title
How do I supply FIles.contentType?
How do I supply Files.contentType?
Jan 29, 2024
Hi there, apologies for the delay. This is certainly something that should be in the client. I can do some digging and get back to you soon. We're also planning to improve the content type checking on the server side in the near term.
How can I provide a value for my file's content type to the partitioning API?
I noticed that the code in
unstructured-api
determines how to partition each file using thecontent_type
attribute attached to the FastAPIUploadFile
. If one is not provided, it tries to infer the file type using the filename extension.My file names are arbitrary UUIDs (no filename extension) so when I try to partition them I get this error
I would like to manually provide a value for
UploadFile.content_type
to avoid the fallback behavior but I don't see a way to do that using the JS client. Can we modify theFiles
definition to include an optional value forcontentType
, which I presume would be used in theunstructured-api
code and result in skipping the fallback path?The text was updated successfully, but these errors were encountered: