Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from azure.storage.blob import BlobClient, BlobProperties, ContainerClient
from azure.storage.blob.aio import BlobClient as AsyncBlobClient
from azure.storage.blob.aio import ContainerClient as AsyncContainerClient
from langchain_core._api import beta
from langchain_core.document_loaders import BaseLoader
from langchain_core.documents.base import Document
from langchain_core.runnables.config import run_in_executor
Expand All @@ -35,6 +36,12 @@
]


@beta(
message=(
"`AzureBlobStorageLoader` is in public preview. "
"Its API is not stable and may change in future versions."
)
)
class AzureBlobStorageLoader(BaseLoader):
"""Document loader for LangChain Document objects from Azure Blob Storage."""

Expand Down Expand Up @@ -202,7 +209,7 @@ def _write_to_temp_file(
blob_client: Union[BlobClient, AsyncBlobClient],
temp_dir_name: str,
) -> str:
blob_name = os.path.basename(blob_client.blob_name)
blob_name = os.path.basename(blob_client.blob_name) # type: ignore[union-attr]
temp_file_path = os.path.join(temp_dir_name, blob_name)
with open(temp_file_path, "wb") as file:
file.write(blob_content)
Expand Down
Loading