# translate_citations_to_grounding_metadata

> **Function** in `langchain_google_genai`

📖 [View in docs](https://reference.langchain.com/python/langchain-google-genai/_compat/translate_citations_to_grounding_metadata)

Translate LangChain Citations to Google AI grounding metadata format.

## Signature

```python
translate_citations_to_grounding_metadata(
    citations: list[types.Citation],
    web_search_queries: list[str] | None = None,
) -> dict[str, Any]
```

## Description

**Example:**

```python
citations = [
    create_citation(
        url="https://uefa.com/euro2024",
        title="UEFA Euro 2024 Results",
        start_index=0,
        end_index=47,
        cited_text="Spain won the UEFA Euro 2024 championship",
    )
]

metadata = translate_citations_to_grounding_metadata(citations)
len(metadata["groundingChunks"])
# -> 1

metadata["groundingChunks"][0]["web"]["uri"]
# -> 'https://uefa.com/euro2024'
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `citations` | `list[types.Citation]` | Yes | List of `Citation` content blocks. |
| `web_search_queries` | `list[str] \| None` | No | Optional list of search queries that generated the grounding data. (default: `None`) |

## Returns

`dict[str, Any]`

Google AI grounding metadata dictionary.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-google/blob/982e4015b249de8b9ba1e787746d8cc1f6d6b790/libs/genai/langchain_google_genai/_compat.py#L9)