Home / Function/ test_openai_model_param() — langchain Function Reference

test_openai_model_param() — langchain Function Reference

Architecture documentation for the test_openai_model_param() function in test_base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  46a1b96d_760c_d09d_dc7d_70be179ffde2["test_openai_model_param()"]
  6395ab08_3ae5_72d1_1c6a_5b74f14238f7["test_base.py"]
  46a1b96d_760c_d09d_dc7d_70be179ffde2 -->|defined in| 6395ab08_3ae5_72d1_1c6a_5b74f14238f7
  style 46a1b96d_760c_d09d_dc7d_70be179ffde2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/llms/test_base.py lines 12–29

def test_openai_model_param() -> None:
    llm = OpenAI(model="foo")
    assert llm.model_name == "foo"
    llm = OpenAI(model_name="foo")  # type: ignore[call-arg]
    assert llm.model_name == "foo"

    # Test standard tracing params
    ls_params = llm._get_ls_params()
    assert ls_params == {
        "ls_provider": "openai",
        "ls_model_type": "llm",
        "ls_model_name": "foo",
        "ls_temperature": 0.7,
        "ls_max_tokens": 256,
    }

    ls_params = llm._get_ls_params(model="bar")
    assert ls_params["ls_model_name"] == "bar"

Domain

Subdomains

Frequently Asked Questions

What does test_openai_model_param() do?
test_openai_model_param() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/llms/test_base.py.
Where is test_openai_model_param() defined?
test_openai_model_param() is defined in libs/partners/openai/tests/unit_tests/llms/test_base.py at line 12.

Analyze Your Own Codebase

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

Try Supermodel Free