o
    2f
                     @   s   d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dl m	Z	 d d	l m
Z
 d d
lmZ d dlmZ G dd dZdS )    )UnstructuredWordDocumentLoader)UnstructuredCSVLoader)UnstructuredExcelLoader)PyPDFLoader)UnstructuredPowerPointLoader)UnstructuredXMLLoader)
JSONLoader)
TextLoader)UnstructuredMarkdownLoader)UnstructuredTSVLoader)UnstructuredHTMLLoaderc                   @   sl   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dd Zdd Zdd Zdd ZdS )DocumentLoaderc                 C   s   d S N )selfr   r   D/var/www/html/AlliBotV5_chatbot/AlliBotV50/Loader_functions_utils.py__init__   s   zDocumentLoader.__init__c                 C      t |dd}| }|S )Nelements)mode)r   load)r   excel_file_nameloaderdocsr   r   r   excel_file_loader      z DocumentLoader.excel_file_loaderc                 C      t |}| }|S )z, This loader will support doc and docx files)r   r   )r   docx_doc_file_pathr   r   r   r   r   doc_docx_file_loader   s   z#DocumentLoader.doc_docx_file_loaderc                 C   r   r   )r   r   )r   csv_filepathr   r   r   r   r   csv_file_loader      zDocumentLoader.csv_file_loaderc                 C   r   r   )r   r   )r   pdf_filepathr   r   r   r   r   pdf_file_loader$   r!   zDocumentLoader.pdf_file_loaderc                 C   r   r   )r   r   )r   pptx_filepathr   r   r   r   r   pptx_file_loader)   r!   zDocumentLoader.pptx_file_loaderc                 C   r   r   )r   r   )r   xml_filepathr   r   r   r   r   xml_file_loader.   r!   zDocumentLoader.xml_file_loaderc                 C      t |ddd}| }|S )N.F)	file_path	jq_schematext_content)r   r   )r   json_filepathr   r   r   r   r   json_file_loader3      zDocumentLoader.json_file_loaderc                 C   r   r   )r	   r   )r   text_filepathr   r   r   r   r   text_file_loader8   r!   zDocumentLoader.text_file_loaderc                 C   r(   )Nsinglefast)r   strategy)r
   r   )r   md_filepathr   r   r   r   r   markdown_file_loader=   r/   z#DocumentLoader.markdown_file_loaderc                 C   r   Nr   )r*   r   )r   r   )r   tsv_filepathr   r   r   r   r   tsv_file_loaderB   r   zDocumentLoader.tsv_file_loaderc                 C   r   r7   )r   r   )r   html_filepathr   r   r   r   r   html_file_loaderG   r   zDocumentLoader.html_file_loaderN)__name__
__module____qualname__r   r   r   r    r#   r%   r'   r.   r1   r6   r9   r;   r   r   r   r   r      s    r   N)$langchain_community.document_loadersr   r   r   r   r   r   langchain.document_loadersr   r	   r
   (langchain_community.document_loaders.tsvr   )langchain_community.document_loaders.htmlr   r   r   r   r   r   <module>   s    