o
    Zh                     @  s   d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	m
Z
mZ d dlmZ d dlmZ er6d dlmZ d	ZG d
d dee	ZdS )    )annotationsN)TYPE_CHECKINGList)Document)	BaseModel
ConfigDictField)
BaseLoader)UnstructuredFileLoader)Filei  P c                   @  s8   e Zd ZU dZedZded< 	 eddZdd	d
Z	dS )OneDriveFileLoaderz&Load a file from `Microsoft OneDrive`..r   fileT)Zarbitrary_types_allowedreturnList[Document]c                 C  s^   t  !}| d| jj }| jj|td t|}| W  d   S 1 s(w   Y  dS )zLoad Documents/)Zto_path
chunk_sizeN)tempfileTemporaryDirectoryr   namedownload
CHUNK_SIZEr
   load)selftemp_dir	file_pathloader r   i/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/document_loaders/onedrive_file.pyr      s   
$zOneDriveFileLoader.loadN)r   r   )
__name__
__module____qualname____doc__r   r   __annotations__r   Zmodel_configr   r   r   r   r   r      s   
 r   )
__future__r   r   typingr   r   Zlangchain_core.documentsr   Zpydanticr   r   r   Z)langchain_community.document_loaders.baser	   Z1langchain_community.document_loaders.unstructuredr
   Z
O365.driver   r   r   r   r   r   r   <module>   s    