Home / Function/ test_hub_runnable_configurable_alternative() — langchain Function Reference

test_hub_runnable_configurable_alternative() — langchain Function Reference

Architecture documentation for the test_hub_runnable_configurable_alternative() function in test_hub.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  591aa6e4_b33b_0d25_ca99_21e77558ca76["test_hub_runnable_configurable_alternative()"]
  00978a8e_81b9_8bd7_8934_945aec6437fe["test_hub.py"]
  591aa6e4_b33b_0d25_ca99_21e77558ca76 -->|defined in| 00978a8e_81b9_8bd7_8934_945aec6437fe
  style 591aa6e4_b33b_0d25_ca99_21e77558ca76 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/runnables/test_hub.py lines 46–64

def test_hub_runnable_configurable_alternative(mock_pull: Mock) -> None:
    mock_pull.side_effect = repo_lookup

    original: HubRunnable = HubRunnable("efriis/my-prompt-1")
    obj_a1 = original.configurable_alternatives(
        ConfigurableField(id="owner_repo_commit", name="Hub ID"),
        default_key="a1",
        a2=HubRunnable("efriis/my-prompt-2"),
    )

    obj_a2 = obj_a1.with_config(configurable={"owner_repo_commit": "a2"})

    templated = obj_a1.invoke({})
    message_a1 = templated.messages[1]
    assert message_a1.content == "1"

    templated_2 = obj_a2.invoke({})
    message_a2 = templated_2.messages[1]
    assert message_a2.content == "2"

Domain

Subdomains

Frequently Asked Questions

What does test_hub_runnable_configurable_alternative() do?
test_hub_runnable_configurable_alternative() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/runnables/test_hub.py.
Where is test_hub_runnable_configurable_alternative() defined?
test_hub_runnable_configurable_alternative() is defined in libs/langchain/tests/unit_tests/runnables/test_hub.py at line 46.

Analyze Your Own Codebase

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

Try Supermodel Free