# extract_files

> **Function** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/_openapi_client/_utils/_utils/extract_files)

Recursively extract files from the given dictionary based on specified paths.

A path may look like this ['foo', 'files', '<array>', 'data'].

``array_format`` controls how ``<array>`` segments contribute to the emitted
field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and
``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``).

Note: this mutates the given dictionary.

## Signature

```python
extract_files(
    query: Mapping[str, object],
    *,
    paths: Sequence[Sequence[str]],
    array_format: ArrayFormat = 'brackets',
) -> list[tuple[str, FileTypes]]
```

---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/687fc8d527a28504432f52bd08c75f2894c209fe/python/langsmith/_openapi_client/_utils/_utils.py#L37)