Home / Function/ test_loads_openai_chat() — langchain Function Reference

test_loads_openai_chat() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ce263e6c_2331_89de_61d6_3b23e3d242d3["test_loads_openai_chat()"]
  f594231b_8e8d_61b8_e688_99b6f31430d1["test_load.py"]
  ce263e6c_2331_89de_61d6_3b23e3d242d3 -->|defined in| f594231b_8e8d_61b8_e688_99b6f31430d1
  style ce263e6c_2331_89de_61d6_3b23e3d242d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/test_load.py lines 38–50

def test_loads_openai_chat() -> None:
    llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0.5, openai_api_key="hello")  # type: ignore[call-arg]
    llm_string = dumps(llm)
    llm2 = loads(
        llm_string,
        secrets_map={"OPENAI_API_KEY": "hello"},
        allowed_objects=[ChatOpenAI],
    )

    assert llm2.dict() == llm.dict()
    llm_string_2 = dumps(llm2)
    assert llm_string_2 == llm_string
    assert isinstance(llm2, ChatOpenAI)

Domain

Subdomains

Frequently Asked Questions

What does test_loads_openai_chat() do?
test_loads_openai_chat() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/test_load.py.
Where is test_loads_openai_chat() defined?
test_loads_openai_chat() is defined in libs/partners/openai/tests/unit_tests/test_load.py at line 38.

Analyze Your Own Codebase

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

Try Supermodel Free