fix: Improve file metadata extraction and loading (#9985)

* Improve file metadata extraction and loading

Refactored _extract_file_metadata to handle cases where file_path is nested in data. Updated load_files to be async and to use extracted metadata for each row. Changed Message construction to unpack metadata as keyword arguments.

* Update base_file.py
This commit is contained in:
Edwin Jose
2025-09-26 10:55:01 -05:00
committed by GitHub
parent a7825e14c9
commit ea3bb2b469

View File

@ -301,7 +301,7 @@ class BaseFileComponent(Component, ABC):
if not metadata:
metadata = await self._extract_file_metadata(data_item)
return Message(text=sep.join(parts), metadata=metadata)
return Message(text=sep.join(parts), **metadata)
def load_files_path(self) -> Message:
"""Returns a Message containing file paths from loaded files.