Home / Function/ test_o1() — langchain Function Reference

test_o1() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  388a2c9b_c5b1_536b_9901_2065b8a55737["test_o1()"]
  bd382a4e_442c_13ae_530c_6e34bc43623d["test_base.py"]
  388a2c9b_c5b1_536b_9901_2065b8a55737 -->|defined in| bd382a4e_442c_13ae_530c_6e34bc43623d
  style 388a2c9b_c5b1_536b_9901_2065b8a55737 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/integration_tests/chat_models/test_base.py lines 1061–1081

def test_o1(use_max_completion_tokens: bool, use_responses_api: bool) -> None:
    # o1 models need higher token limits for reasoning
    o1_token_limit = 1000
    if use_max_completion_tokens:
        kwargs: dict = {"max_completion_tokens": o1_token_limit}
    else:
        kwargs = {"max_tokens": o1_token_limit}
    response = ChatOpenAI(
        model="o1",
        reasoning_effort="low",
        use_responses_api=use_responses_api,
        **kwargs,
    ).invoke(
        [
            {"role": "developer", "content": "respond in all caps"},
            {"role": "user", "content": "HOW ARE YOU"},
        ]
    )
    assert isinstance(response, AIMessage)
    assert isinstance(response.text, str)
    assert response.text.upper() == response.text

Domain

Subdomains

Frequently Asked Questions

What does test_o1() do?
test_o1() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py.
Where is test_o1() defined?
test_o1() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py at line 1061.

Analyze Your Own Codebase

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

Try Supermodel Free