Home / Function/ test_translate_grounding_metadata_none() — langchain Function Reference

test_translate_grounding_metadata_none() — langchain Function Reference

Architecture documentation for the test_translate_grounding_metadata_none() function in test_google_genai.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  7fd53770_2559_a9fb_ecfd_08a1d6fa3266["test_translate_grounding_metadata_none()"]
  25aec1a3_6028_10e6_bb5b_1c7319a29818["test_google_genai.py"]
  7fd53770_2559_a9fb_ecfd_08a1d6fa3266 -->|defined in| 25aec1a3_6028_10e6_bb5b_1c7319a29818
  style 7fd53770_2559_a9fb_ecfd_08a1d6fa3266 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/block_translators/test_google_genai.py lines 96–130

def test_translate_grounding_metadata_none() -> None:
    """Test translation when both web and maps are None."""
    grounding_metadata = {
        "grounding_chunks": [
            {
                "web": None,
                "maps": None,
            }
        ],
        "grounding_supports": [
            {
                "segment": {
                    "start_index": 0,
                    "end_index": 10,
                    "text": "test text",
                },
                "grounding_chunk_indices": [0],
                "confidence_scores": [],
            }
        ],
        "web_search_queries": [],
    }

    citations = translate_grounding_metadata_to_citations(grounding_metadata)

    # Should still create citation but without url/title fields when None
    assert len(citations) == 1
    citation = citations[0]
    assert citation["type"] == "citation"
    # url and title are omitted when None
    assert "url" not in citation
    assert "title" not in citation
    assert citation.get("start_index") == 0
    assert citation.get("end_index") == 10
    assert citation.get("cited_text") == "test text"

Domain

Subdomains

Frequently Asked Questions

What does test_translate_grounding_metadata_none() do?
test_translate_grounding_metadata_none() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_google_genai.py.
Where is test_translate_grounding_metadata_none() defined?
test_translate_grounding_metadata_none() is defined in libs/core/tests/unit_tests/messages/block_translators/test_google_genai.py at line 96.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free