-
Notifications
You must be signed in to change notification settings - Fork 648
FEAT: Add binary_path data type #1315
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
Conversation
|
"content is no longer passed as an arg to value in data_serializer_factory. This was misleading since value should be a file path and was overriden in save_data method call in the next line anyways." |
Line 412 of pdf_converter.py :) @hannahwestra25 |
Description
Adds a new
binary_pathdata type to represent arbitrary binary data stored in blob or disk storage, particularly useful for XPIA attacks where targets may not support specific file types.binary_pathtoPromptDataTypeLiteral inliterals.pyBlobPathDataTypeSerializerclass indata_type_serializer.pywheredata_on_disk()=True, uses/binariessubdirectory, default extension.bindata_serializer_factoryto routebinary_pathto the new serializerPDFConverterto outputbinary_pathinstead ofurlwhich was semantically incorrect.Minor change:
contentis no longer passed as an arg tovalueindata_serializer_factoryin PDF converter. This was misleading sincevalueshould be a file path and was overriden insave_datamethod call in the next line anyways.Tests and Documentation
Tests added/updated:
test_data_type_serializer.py:test_literals.pyto includebinary_pathin expected literalstest_pdf_converter.pyto expectbinary_pathoutput type instead ofurltest_prompt_converter.pyto ensure correctexpected_output_typeNotebook:
5_file_converters.ipynbnotebook