a
    bg^                     @   sH   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 deZ	dS )    )IteratorOptional)Document)
BaseLoader)PubMedAPIWrapperc                   @   s8   e Zd ZdZd
eee dddZee	 dddZ
d	S )PubMedLoaderzLoad from the `PubMed` biomedical library.

    Attributes:
        query: The query to be passed to the PubMed API.
        load_max_docs: The maximum number of documents to load.
       )queryload_max_docsc                 C   s   || _ || _t|d| _dS )zInitialize the PubMedLoader.

        Args:
            query: The query to be passed to the PubMed API.
            load_max_docs: The maximum number of documents to load.
              Defaults to 3.
        )Ztop_k_resultsN)r	   r
   r   _client)selfr	   r
    r   y/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain_community/document_loaders/pubmed.py__init__   s
    zPubMedLoader.__init__)returnc                 c   s   | j | jD ]
}|V  qd S )N)r   Zlazy_load_docsr	   )r   docr   r   r   	lazy_load#   s    zPubMedLoader.lazy_loadN)r   )__name__
__module____qualname____doc__strr   intr   r   r   r   r   r   r   r   r   	   s   
 r   N)
typingr   r   Zlangchain_core.documentsr   Z)langchain_community.document_loaders.baser   Z$langchain_community.utilities.pubmedr   r   r   r   r   r   <module>   s   