Home / Function/ test_loads_llmchain() — langchain Function Reference

test_loads_llmchain() — langchain Function Reference

Architecture documentation for the test_loads_llmchain() function in test_load.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  851f5ae1_a374_50fe_f9e2_5c76a0d51406["test_loads_llmchain()"]
  0b08876e_5a62_23f2_8ed5_ec59f46366a7["test_load.py"]
  851f5ae1_a374_50fe_f9e2_5c76a0d51406 -->|defined in| 0b08876e_5a62_23f2_8ed5_ec59f46366a7
  style 851f5ae1_a374_50fe_f9e2_5c76a0d51406 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/load/test_load.py lines 42–60

def test_loads_llmchain() -> None:
    from langchain_openai import OpenAI

    llm = CommunityOpenAI(
        model="davinci",
        temperature=0.5,
        openai_api_key="hello",
        top_p=0.8,
    )
    prompt = PromptTemplate.from_template("hello {name}!")
    chain = LLMChain(llm=llm, prompt=prompt)
    chain_string = dumps(chain)
    chain2 = loads(chain_string, secrets_map={"OPENAI_API_KEY": "hello"})

    assert chain2 == chain
    assert dumps(chain2) == chain_string
    assert isinstance(chain2, LLMChain)
    assert isinstance(chain2.llm, OpenAI)
    assert isinstance(chain2.prompt, PromptTemplate)

Domain

Subdomains

Frequently Asked Questions

What does test_loads_llmchain() do?
test_loads_llmchain() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/load/test_load.py.
Where is test_loads_llmchain() defined?
test_loads_llmchain() is defined in libs/langchain/tests/unit_tests/load/test_load.py at line 42.

Analyze Your Own Codebase

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

Try Supermodel Free