Home / Function/ test_perplexity_new_params() — langchain Function Reference

test_perplexity_new_params() — langchain Function Reference

Architecture documentation for the test_perplexity_new_params() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  b1d86f86_43af_321c_deeb_51386a0b322a["test_perplexity_new_params()"]
  c1722844_1503_63a7_de81_d01bf41ba40d["test_chat_models.py"]
  b1d86f86_43af_321c_deeb_51386a0b322a -->|defined in| c1722844_1503_63a7_de81_d01bf41ba40d
  style b1d86f86_43af_321c_deeb_51386a0b322a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/perplexity/tests/unit_tests/test_chat_models.py lines 44–67

def test_perplexity_new_params() -> None:
    """Test new Perplexity-specific parameters."""
    web_search_options = WebSearchOptions(search_type="pro", search_context_size="high")
    media_response = MediaResponse(overrides={"return_videos": True})

    llm = ChatPerplexity(
        model="sonar-pro",
        search_mode="academic",
        web_search_options=web_search_options,
        media_response=media_response,
        return_images=True,
    )

    params = llm._default_params
    assert params["search_mode"] == "academic"
    assert params["web_search_options"] == {
        "search_type": "pro",
        "search_context_size": "high",
    }

    assert params["extra_body"]["media_response"] == {
        "overrides": {"return_videos": True}
    }
    assert params["return_images"] is True

Domain

Subdomains

Frequently Asked Questions

What does test_perplexity_new_params() do?
test_perplexity_new_params() is a function in the langchain codebase, defined in libs/partners/perplexity/tests/unit_tests/test_chat_models.py.
Where is test_perplexity_new_params() defined?
test_perplexity_new_params() is defined in libs/partners/perplexity/tests/unit_tests/test_chat_models.py at line 44.

Analyze Your Own Codebase

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

Try Supermodel Free