
    3fi                     N    d dl mZmZ d dlmZ d dlmZ d dlmZ  G d de      Z	y)    )IteratorOptional)Document)
BaseLoader)UnstructuredFileIOLoaderc                   :    e Zd ZdZddedee   fdZdee   fdZ	y)	AzureAIDataLoaderzLoad from Azure AI Data.Nurlglobc                 "    || _         	 || _        y)zAInitialize with URL to a data asset or storage location
        .N)r
   glob_pattern)selfr
   r   s      p/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_community/document_loaders/azure_ai_data.py__init__zAzureAIDataLoader.__init__   s     8 F    returnc              #     K   	 ddl m}  || j                        }| j                  r|j                  | j                        }n|j                         }|D ]@  }|j                  |      5 }t        |      }|j                         E d{    ddd       B y# t        $ r}t        d      |d}~ww xY w7 ,# 1 sw Y   lxY ww)zA lazy loader for Documents.r   )AzureMachineLearningFileSystemz[Could not import azureml-fspec package.Please install it with `pip install azureml-fsspec`.N)file)
azureml.fsspecr   ImportErrorr
   r   r   lsopenr   load)r   r   excfsremote_paths_listremote_pathfloaders           r   	lazy_loadzAzureAIDataLoader.lazy_load   s     	E ,DHH5 "(9(9 : ", 	)K% )1q9!;;=(() )	)  	G 	  )) )sR   CB A C* B9
B7B9C	B4#B//B44C7B99C	>C)N)
__name__
__module____qualname____doc__strr   r   r   r   r!    r   r   r	   r	      s0    "GC Gx} G)8H- )r   r	   N)
typingr   r   %langchain_community.docstore.documentr   )langchain_community.document_loaders.baser   1langchain_community.document_loaders.unstructuredr   r	   r'   r   r   <module>r,      s    % : @ V)
 )r   