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

# autogen.retrieve_utils.get_files_from_dir

<code class="doc-symbol doc-symbol-heading doc-symbol-function" />

#### get\_files\_from\_dir

```python theme={null}
get_files_from_dir(
    dir_path: str | list[str],
    types: list[str] = ['txt', 'json', 'csv', 'tsv', 'md', 'html', 'htm', 'rtf', 'rst', 'jsonl', 'log', 'xml', 'yaml', 'yml', 'pdf', 'mdx'],
    recursive: bool = True
) -> list[Any]
```

Return a list of all the files in a given directory, a url, a file path or a list of them.

<b>Parameters:</b>

| Name        | Description                                                                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `dir_path`  | **Type:** str \| list\[str]                                                                                                                                        |
| `types`     | **Type:** list\[str]<br /><br />**Default:** \['txt', 'json', 'csv', 'tsv', 'md', 'html', 'htm', 'rtf', 'rst', 'jsonl', 'log', 'xml', 'yaml', 'yml', 'pdf', 'mdx'] |
| `recursive` | **Type:** bool<br /><br />**Default:** True                                                                                                                        |

<br />
