[docs]classPubMedLoader(BaseLoader):"""Load 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. """
[docs]def__init__(self,query:str,load_max_docs:Optional[int]=3,):"""Initialize 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. """self.query=queryself.load_max_docs=load_max_docsself._client=PubMedAPIWrapper(# type: ignore[call-arg]top_k_results=load_max_docs,# type: ignore[arg-type])