-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: allow mime_type to be guessed for ByteStream #9573
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
Merged
julian-risch
merged 14 commits into
deepset-ai:main
from
kanenorman:feat_bytestream_guess_mime_type
Jul 22, 2025
+177
−27
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
239766f
feat(bytestream): add guess_mime_type parameter
kanenorman 6284787
refactor(FileTypeRouter): refactor guess mimetype
kanenorman ef15e95
feat(bytestream): add guess_mime_type to util
kanenorman ac399fb
style(ruff): add trailing whitespace
kanenorman 8096fe6
fix: fix type annotation
kanenorman 18946c9
test(file_type_router): add test for additional_mimetypes param
kanenorman bff0c07
fix(file_type_router): non-existent file behavior
kanenorman a5a2e2d
feat(file_type_router): add release notes
kanenorman a375a0b
Merge branch 'main' into feat_bytestream_guess_mime_type
kanenorman 8b0908c
fix(file_type_router): remove unused logger
kanenorman 250bca7
Merge branch 'main' into feat_bytestream_guess_mime_type
kanenorman 8da2267
style: fix ruff formatting magic values
kanenorman a32aac8
test(bytestream): handle windows/unix mimetype differences
kanenorman 92e794a
Merge branch 'main' into feat_bytestream_guess_mime_type
julian-risch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
releasenotes/notes/add-bytestream-guess-mime-type-e973262fa75f2982.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
enhancements: | ||
- | | ||
Add `guess_mime_type` parameter to `Bytestream.from_file_path()` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the test cases here, I suggest we add a test case for FileTypeRouter in
test/components/routers/test_file_router.py
checking that the parameteradditional_mimetypes
still works as expected. We're doingmimetypes.add_type(mime, ext)
there and need to check that whenget_bytestream_from_source
it's taking into account these additional mimetypes, for example:{"application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx"}
.