# get_cache_dir

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/utils/get_cache_dir)

Get the testing cache directory.

## Signature

```python
get_cache_dir(
    cache: Optional[str],
) -> Optional[str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `cache` | `Optional[str]` | Yes | The cache path. |

## Returns

`Optional[str]`

The cache path if provided, otherwise the value from the `LANGSMITH_TEST_CACHE`

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/6a74bf5af9e542d8065af8edca54b2448f430916/python/langsmith/utils.py#L529)