test_citations_and_search_results() — langchain Function Reference
Architecture documentation for the test_citations_and_search_results() function in test_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD fffc55c5_1247_49b0_8605_4a25a6dc3963["test_citations_and_search_results()"] 974a163b_6ea0_9385_8678_c36e3c96fcdf["TestChatPerplexityIntegration"] fffc55c5_1247_49b0_8605_4a25a6dc3963 -->|defined in| 974a163b_6ea0_9385_8678_c36e3c96fcdf style fffc55c5_1247_49b0_8605_4a25a6dc3963 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/perplexity/tests/integration_tests/test_chat_models.py lines 60–71
def test_citations_and_search_results(self) -> None:
"""Test that citations and search results are returned."""
chat = ChatPerplexity(model="sonar", temperature=0)
message = HumanMessage(content="Who is the CEO of OpenAI?")
response = chat.invoke([message])
# Citations are usually in additional_kwargs
assert "citations" in response.additional_kwargs
# Search results might be there too
# Note: presence depends on whether search was performed
if response.additional_kwargs.get("citations"):
assert len(response.additional_kwargs["citations"]) > 0
Domain
Subdomains
Source
Frequently Asked Questions
What does test_citations_and_search_results() do?
test_citations_and_search_results() is a function in the langchain codebase, defined in libs/partners/perplexity/tests/integration_tests/test_chat_models.py.
Where is test_citations_and_search_results() defined?
test_citations_and_search_results() is defined in libs/partners/perplexity/tests/integration_tests/test_chat_models.py at line 60.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free