Home / Function/ test_initialize_azure_openai_with_openai_api_base_set() — langchain Function Reference

test_initialize_azure_openai_with_openai_api_base_set() — langchain Function Reference

Architecture documentation for the test_initialize_azure_openai_with_openai_api_base_set() function in test_azure.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  fda415ee_4601_1fb2_9f82_bce83a0356d6["test_initialize_azure_openai_with_openai_api_base_set()"]
  c0f70782_2552_3264_2ecc_ede3cff537f7["test_azure.py"]
  fda415ee_4601_1fb2_9f82_bce83a0356d6 -->|defined in| c0f70782_2552_3264_2ecc_ede3cff537f7
  style fda415ee_4601_1fb2_9f82_bce83a0356d6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/chat_models/test_azure.py lines 48–67

def test_initialize_azure_openai_with_openai_api_base_set() -> None:
    with mock.patch.dict(os.environ, {"OPENAI_API_BASE": "https://api.openai.com"}):
        llm = AzureChatOpenAI(  # type: ignore[call-arg, call-arg]
            api_key="xyz",  # type: ignore[arg-type]
            azure_endpoint="my-base-url",
            azure_deployment="35-turbo-dev",
            openai_api_version="2023-05-15",
            temperature=0,
            openai_api_base=None,
        )
        assert llm.openai_api_key is not None
        assert llm.openai_api_key.get_secret_value() == "xyz"
        assert llm.azure_endpoint == "my-base-url"
        assert llm.deployment_name == "35-turbo-dev"
        assert llm.openai_api_version == "2023-05-15"
        assert llm.temperature == 0

        ls_params = llm._get_ls_params()
        assert ls_params["ls_provider"] == "azure"
        assert ls_params["ls_model_name"] == "35-turbo-dev"

Domain

Subdomains

Frequently Asked Questions

What does test_initialize_azure_openai_with_openai_api_base_set() do?
test_initialize_azure_openai_with_openai_api_base_set() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/chat_models/test_azure.py.
Where is test_initialize_azure_openai_with_openai_api_base_set() defined?
test_initialize_azure_openai_with_openai_api_base_set() is defined in libs/partners/openai/tests/unit_tests/chat_models/test_azure.py at line 48.

Analyze Your Own Codebase

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

Try Supermodel Free