test_translate_grounding_metadata_maps() — langchain Function Reference
Architecture documentation for the test_translate_grounding_metadata_maps() function in test_google_genai.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 69280878_beb5_9668_2b22_b03c6b031065["test_translate_grounding_metadata_maps()"] 25aec1a3_6028_10e6_bb5b_1c7319a29818["test_google_genai.py"] 69280878_beb5_9668_2b22_b03c6b031065 -->|defined in| 25aec1a3_6028_10e6_bb5b_1c7319a29818 style 69280878_beb5_9668_2b22_b03c6b031065 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/block_translators/test_google_genai.py lines 51–93
def test_translate_grounding_metadata_maps() -> None:
"""Test translation of maps grounding metadata to citations."""
grounding_metadata = {
"grounding_chunks": [
{
"web": None,
"maps": {
"uri": "https://maps.google.com/?cid=13100894621228039586",
"title": "Heaven on 7th Marketplace",
"placeId": "places/ChIJ0-zA1vBZwokRon0fGj-6z7U",
},
}
],
"grounding_supports": [
{
"segment": {
"start_index": 0,
"end_index": 25,
"text": "Great Italian restaurant",
},
"grounding_chunk_indices": [0],
"confidence_scores": [0.95],
}
],
"web_search_queries": [],
}
citations = translate_grounding_metadata_to_citations(grounding_metadata)
assert len(citations) == 1
citation = citations[0]
assert citation["type"] == "citation"
assert citation.get("url") == "https://maps.google.com/?cid=13100894621228039586"
assert citation.get("title") == "Heaven on 7th Marketplace"
assert citation.get("start_index") == 0
assert citation.get("end_index") == 25
assert citation.get("cited_text") == "Great Italian restaurant"
extras = citation.get("extras", {})["google_ai_metadata"]
assert extras["web_search_queries"] == []
assert extras["grounding_chunk_index"] == 0
assert extras["confidence_scores"] == [0.95]
assert extras["place_id"] == "places/ChIJ0-zA1vBZwokRon0fGj-6z7U"
Domain
Subdomains
Source
Frequently Asked Questions
What does test_translate_grounding_metadata_maps() do?
test_translate_grounding_metadata_maps() 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_maps() defined?
test_translate_grounding_metadata_maps() is defined in libs/core/tests/unit_tests/messages/block_translators/test_google_genai.py at line 51.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free