-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I supply Files.contentType
?
#20
Comments
contentType
be an optional parameter?FIles.contentType
?
FIles.contentType
?Files.contentType
?
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. |
Hi @awalker4! Do you have any updates on this front? We'd like to upgrade to the new version of the JS client but we get the infamous |
Hi Omar, sorry for the delays! We still need to get Separately, I have an internal ticket to improve server side file handling. We can address the |
No problem! Thanks for the quick response! Yes, once we upgrade we can continue to provide the For now, we've decided to stay on the older client version because we started running into |
Also when supplying |
You can do this const blob = await openAsBlob('path/to/filename.pdf');
const name = 'filename.pdf';
const file = new File([blob], name); |
Hi all, we've merged a fix for the API that removes the naive extension check and does an actual filetype detection. This will get rid of the |
We've added the @alimoezzi I created #100 for the pdf page splitting bug. |
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: