
    ih^                     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)PubMedAPIWrapperc                   <    e Zd ZdZ	 ddedee   fdZdee	   fdZ
y)	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                 B    || _         || _        t        |      | _        y)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.
        )top_k_resultsN)r
   r   r   _client)selfr
   r   s      i/var/www/html/dev/engine/venv/lib/python3.12/site-packages/langchain_community/document_loaders/pubmed.py__init__zPubMedLoader.__init__   s"     
*''
    returnc              #   h   K   | j                   j                  | j                        D ]  }|  y w)N)r   lazy_load_docsr
   )r   docs     r   	lazy_loadzPubMedLoader.lazy_load#   s-     <<..tzz: 	CI	s   02N)   )__name__
__module____qualname____doc__strr   intr   r   r   r    r   r   r	   r	   	   s8     ()

  }
$8H- r   r	   N)
typingr   r   langchain_core.documentsr   )langchain_community.document_loaders.baser   $langchain_community.utilities.pubmedr   r	   r   r   r   <module>r$      s    % - @ A: r   