§
    šŠtj   ã                   ó˜   — d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
mZ d dlmZ  eddd¬	¦  «         G d
„ dee
¦  «        ¦   «         ZdS )é    )ÚAnyÚCallableÚDictÚList)Ú
deprecated)ÚDocument)Ú	BaseModelÚmodel_validator)Ú
BaseLoaderz0.3.18zÌThis class is deprecated and will be removed in a future version. You can swap to using the `ApifyDatasetLoader` implementation in `langchain_apify` package. See <https://github.com/apify/langchain-apify>z"langchain_apify.ApifyDatasetLoader)ÚsinceÚmessageÚalternative_importc                   óÒ   ‡ — e Zd ZU dZeed<   	 eed<   	 eege	f         ed<   	 dedeege	f         fˆ fd„Z
 ed¬¦  «        eded	efd
„¦   «         ¦   «         Zd	ee	         fd„Zˆ xZS )ÚApifyDatasetLoadera¡  Load datasets from `Apify` web scraping, crawling, and data extraction platform.

    For details, see https://docs.apify.com/platform/integrations/langchain

    Example:
        .. code-block:: python

            from langchain_community.document_loaders import ApifyDatasetLoader
            from langchain_core.documents import Document

            loader = ApifyDatasetLoader(
                dataset_id="YOUR-DATASET-ID",
                dataset_mapping_function=lambda dataset_item: Document(
                    page_content=dataset_item["text"], metadata={"source": dataset_item["url"]}
                ),
            )
            documents = loader.load()
    Úapify_clientÚ
dataset_idÚdataset_mapping_functionc                 óN   •— t          ¦   «                              ||¬¦  «         dS )ar  Initialize the loader with an Apify dataset ID and a mapping function.

        Args:
            dataset_id (str): The ID of the dataset on the Apify platform.
            dataset_mapping_function (Callable): A function that takes a single
                dictionary (an Apify dataset item) and converts it to an instance
                of the Document class.
        )r   r   N)ÚsuperÚ__init__)Úselfr   r   Ú	__class__s      €úp/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_community/document_loaders/apify_dataset.pyr   zApifyDatasetLoader.__init__0   s6   ø€ õ 	‰Œ×ÒØ!Ð<Tð 	ñ 	
ô 	
ð 	
ð 	
ð 	
ó    Úbefore)ÚmodeÚvaluesÚreturnc                 óÆ   — 	 ddl m}  |¦   «         }t          |j        d¦  «        x}r|j        dxx         dz  cc<   ||d<   n# t
          $ r t          d¦  «        ‚w xY w|S )zYValidate environment.

        Args:
            values: The values to validate.
        r   )ÚApifyClientÚhttpx_clientz
user-agentz; Origin/langchainr   z`Could not import apify-client Python package. Please install it with `pip install apify-client`.)r   r    ÚgetattrÚhttp_clientÚheadersÚImportError)Úclsr   r    Úclientr!   s        r   Úvalidate_environmentz'ApifyDatasetLoader.validate_environment?   s¦   € ð	Ø0Ð0Ð0Ð0Ð0Ð0à �[‘]”]ˆFÝ& vÔ'9¸>ÑJÔJÐJˆ|ð KØÔ$ \Ð2Ð2Ô2Ð6JÑJÐ2Ð2Ñ2à%+ˆF�>Ñ"Ð"øÝð 	ð 	ð 	ÝðEñô ð ð	øøøð ˆs   ‚AA ÁAc                 ó¶   — | j                              | j        ¦  «                             d¬¦  «        j        }t          t          | j        |¦  «        ¦  «        S )zLoad documents.T)Úclean)r   Údatasetr   Ú
list_itemsÚitemsÚlistÚmapr   )r   Údataset_itemss     r   ÚloadzApifyDatasetLoader.loadX   sP   € ð Ô×%Ò% d¤oÑ6Ô6×AÒAÈÐAÑMÔMÔSð 	õ •C˜Ô5°}ÑEÔEÑFÔFÐFr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__Ústrr   r   r   r   r
   Úclassmethodr(   r   r1   Ú__classcell__)r   s   @r   r   r   
   s  ø€ € € € € € ðð ð& ÐÐÑØTØ€O€O�OØ6Ø&¨ v¨xÐ'7Ô8Ð8Ð8Ñ8ð>ð
Øð
Ø9AÀ4À&È(ÐBRÔ9Sð
ð 
ð 
ð 
ð 
ð 
ð €_˜(Ð#Ñ#Ô#Øð¨$ð °3ð ð ð ñ „[ñ $Ô#ðð.G�d˜8”nð Gð Gð Gð Gð Gð Gð Gð Gr   r   N)Útypingr   r   r   r   Úlangchain_core._apir   Úlangchain_core.documentsr   Úpydanticr	   r
   Ú)langchain_community.document_loaders.baser   r   © r   r   ú<module>r@      sî   ðØ ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,à *Ð *Ð *Ð *Ð *Ð *Ø -Ð -Ð -Ð -Ð -Ð -Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /à @Ð @Ð @Ð @Ð @Ð @ð €Ø
ð	9ð
 <ð	ñ 	ô 	ðIGð IGð IGð IGð IG˜ Yñ IGô IGñ	ô 	ðIGð IGð IGr   