Home / Function/ test_chat_completions_api_uses_model_name() — langchain Function Reference

test_chat_completions_api_uses_model_name() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/partners/openai/tests/unit_tests/chat_models/test_azure.py lines 125–142

def test_chat_completions_api_uses_model_name() -> None:
    """Test that regular Chat Completions API still uses model name."""
    llm = AzureChatOpenAI(
        azure_deployment="your_deployment",
        model="gpt-5",  # This is the OpenAI model name
        api_version="2025-04-01-preview",
        azure_endpoint="your_endpoint",
        api_key=SecretStr("your_api_key"),
        # No Responses-only parameters, so Chat Completions API will be used
    )
    messages = [HumanMessage("Hello")]
    payload = llm._get_request_payload(messages)

    # For Chat Completions API, the model field should still be None/model_name
    # Azure Chat Completions uses deployment in the URL, not in the model field
    assert payload["model"] == "gpt-5"
    assert "messages" in payload  # Chat Completions API uses 'messages'
    assert "input" not in payload

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free