LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessagesblock_translatorsgoogle_genaitranslate_grounding_metadata_to_citations
    Function●Since v1.0

    translate_grounding_metadata_to_citations

    Translate Google AI grounding metadata to LangChain Citations.

    Copy
    translate_grounding_metadata_to_citations(
      grounding_metadata: dict[str, Any]
    ) -> list[Citation]

    Example:

    metadata = { ... "web_search_queries": ["UEFA Euro 2024 winner"], ... "grounding_chunks": [ ... { ... "web": { ... "uri": "https://uefa.com/euro2024", ... "title": "UEFA Euro 2024 Results", ... } ... } ... ], ... "grounding_supports": [ ... { ... "segment": { ... "start_index": 0, ... "end_index": 47, ... "text": "Spain won the UEFA Euro 2024 championship", ... }, ... "grounding_chunk_indices": [0], ... } ... ], ... } citations = translate_grounding_metadata_to_citations(metadata) len(citations) 1 citations[0]["url"] 'https://uefa.com/euro2024'

    Parameters

    NameTypeDescription
    grounding_metadata*dict[str, Any]

    Google AI grounding metadata containing web search queries, grounding chunks, and grounding supports.

    View source on GitHub