# acollapse_docs

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/chains/combine_documents/reduce/acollapse_docs)

Execute a collapse function on a set of documents and merge their metadatas.

## Signature

```python
acollapse_docs(
    docs: list[Document],
    combine_document_func: AsyncCombineDocsProtocol,
    **kwargs: Any = {},
) -> Document
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `docs` | `list[Document]` | Yes | A list of `Document` objects to combine. |
| `combine_document_func` | `AsyncCombineDocsProtocol` | Yes | A function that takes in a list of `Document` objects and optionally addition keyword parameters and combines them into a single string. |
| `**kwargs` | `Any` | No | Arbitrary additional keyword params to pass to the `combine_document_func`. (default: `{}`) |

## Returns

`Document`

A single `Document` with the output of `combine_document_func` for the page
content and the combined metadata's of all the input documents. All metadata
values are strings, and where there are overlapping keys across documents
the values are joined by `', '`.

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/ee95ad6907f5eab94644183393a20aa2a032bb19/libs/langchain/langchain_classic/chains/combine_documents/reduce.py#L99)