> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.toolkits.pubmed toolkit

<a id="camel.toolkits.pubmed_toolkit" />

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit" />

## PubMedToolkit

```python theme={"system"}
class PubMedToolkit(BaseToolkit):
```

A toolkit for interacting with PubMed's E-utilities API to access
MEDLINE data.

This toolkit provides functionality to search and retrieve papers from the
PubMed database, including abstracts, citations, and other metadata.

**Parameters:**

* **timeout** (Optional\[float]): The timeout for API requests in seconds. (default: :obj:`None`)

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.__init__" />

### **init**

```python theme={"system"}
def __init__(self, timeout: Optional[float] = None):
```

Initializes the PubMedToolkit.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit._make_request" />

### \_make\_request

```python theme={"system"}
def _make_request(
    self,
    endpoint: str,
    params: Dict[str, Union[str, int]],
    retries: int = 3
):
```

Makes a request to the PubMed/MEDLINE API with error handling and
retries.

**Parameters:**

* **endpoint** (str): The API endpoint to call.
* **params** (Dict\[str, Union\[str, int]]): Query parameters.
* **retries** (int, optional): Number of retry attempts. (default: :obj:`3`)

**Returns:**

Optional\[Dict\[str, Any]]: JSON response if successful, else None.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.search_papers" />

### search\_papers

```python theme={"system"}
def search_papers(
    self,
    query: str,
    max_results: int = 10,
    sort: str = 'relevance',
    date_range: Optional[Dict[str, str]] = None,
    publication_type: Optional[List[str]] = None
):
```

Search for biomedical papers in MEDLINE via PubMed with advanced
filtering options.

**Parameters:**

* **query** (str): The search query string.
* **max\_results** (int, optional): Maximum number of results to return. (default: :obj:`10`)
* **sort** (str, optional): Sort order - 'relevance' or 'date'. (default: :obj:`"relevance"`)
* **date\_range** (Optional\[Dict\[str, str]], optional): Date range filter with 'from' and 'to' dates in YYYY/MM/DD format. (default: :obj:`None`)
* **publication\_type** (Optional\[List\[str]], optional): Filter by publication types (e.g., \["Journal Article", "Review"]). (default: :obj:`None`)

**Returns:**

List\[Dict\[str, str]]: List of papers with their metadata.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.get_paper_details" />

### get\_paper\_details

```python theme={"system"}
def get_paper_details(
    self,
    paper_id: Union[str, int],
    include_references: bool = False
):
```

Get detailed information about a specific biomedical paper from
MEDLINE/PubMed.

**Parameters:**

* **paper\_id** (Union\[str, int]): PubMed ID of the paper.
* **include\_references** (bool, optional): Whether to include referenced papers. (default: :obj:`False`)

**Returns:**

Optional\[Dict\[str, Any]]: Paper details including title, authors,
abstract, etc., or None if retrieval fails.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.get_abstract" />

### get\_abstract

```python theme={"system"}
def get_abstract(self, paper_id: Union[str, int]):
```

Get the abstract of a specific biomedical paper from MEDLINE/
PubMed.

**Parameters:**

* **paper\_id** (Union\[str, int]): PubMed ID of the paper.

**Returns:**

str: The abstract text.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.get_citation_count" />

### get\_citation\_count

```python theme={"system"}
def get_citation_count(self, paper_id: Union[str, int]):
```

Get the number of citations for a biomedical paper in MEDLINE/
PubMed.

**Parameters:**

* **paper\_id** (Union\[str, int]): PubMed ID of the paper.

**Returns:**

int: Number of citations, or 0 if retrieval fails.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.get_related_papers" />

### get\_related\_papers

```python theme={"system"}
def get_related_papers(self, paper_id: Union[str, int], max_results: int = 10):
```

Get biomedical papers related to a specific paper in MEDLINE/
PubMed.

**Parameters:**

* **paper\_id** (Union\[str, int]): PubMed ID of the paper.
* **max\_results** (int, optional): Maximum number of results to return. (default: :obj:`10`)

**Returns:**

List\[Dict\[str, Any]]: List of related papers with their metadata.

<a id="camel.toolkits.pubmed_toolkit.PubMedToolkit.get_tools" />

### get\_tools

```python theme={"system"}
def get_tools(self):
```

**Returns:**

List\[FunctionTool]: List of available tools.
