LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
Load file util function fix (#483)
Rahul Johnyc23194efd87e
diff --git a/backend/workflow_manager/endpoint/source.py b/backend/workflow_manager/endpoint/source.pyindex 4dd096044..9a4306e4c 100644--- a/backend/workflow_manager/endpoint/source.py+++ b/backend/workflow_manager/endpoint/source.py@@ -386,6 +386,17 @@ class SourceConnector(BaseConnector):results.append({"file": file_name, "result": result})def load_file(self, input_file_path: str) -> tuple[str, BytesIO]:+ """Load file contnt and file name based on the file path.++ Args:+ input_file_path (str): source file++ Raises:+ InvalidSource: _description_++ Returns:+ tuple[str, BytesIO]: file_name , file content+ """connector: ConnectorInstance = self.endpoint.connector_instanceconnector_settings: dict[str, Any] = connector.connector_metadatasource_fs: fsspec.AbstractFileSystem = self.get_fsspec(@@ -395,7 +406,7 @@ class SourceConnector(BaseConnector):file_content = remote_file.read()file_stream = BytesIO(file_content)- return remote_file.key, file_stream+ return os.path.basename(input_file_path), file_stream@classmethoddef add_input_file_to_api_storage(