# copy_with_links

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/graph_vectorstores/links/copy_with_links)

Return a document with the given links added.

## Signature

```python
copy_with_links(
    doc: Document,
    *links: Union[Link, Iterable[Link]] = (),
) -> Document
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `doc` | `Document` | Yes | The document to add the links to. |
| `*links` | `Union[Link, Iterable[Link]]` | No | The links to add to the document. (default: `()`) |

## Returns

`Document`

A document with a shallow-copy of the metadata with the links added.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/graph_vectorstores/links.py#L196)