Home / Function/ test_output_version_invoke() — langchain Function Reference

test_output_version_invoke() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  b8d72b3e_770c_2c40_176f_1c279f6cd222["test_output_version_invoke()"]
  8830054d_ac1e_daa9_c6c5_ff55b10d0bf3["test_base.py"]
  b8d72b3e_770c_2c40_176f_1c279f6cd222 -->|defined in| 8830054d_ac1e_daa9_c6c5_ff55b10d0bf3
  style b8d72b3e_770c_2c40_176f_1c279f6cd222 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/language_models/chat_models/test_base.py lines 879–895

def test_output_version_invoke(monkeypatch: Any) -> None:
    messages = [AIMessage("hello")]

    llm = GenericFakeChatModel(messages=iter(messages), output_version="v1")
    response = llm.invoke("hello")
    assert response.content == [{"type": "text", "text": "hello"}]
    assert response.response_metadata["output_version"] == "v1"

    llm = GenericFakeChatModel(messages=iter(messages))
    response = llm.invoke("hello")
    assert response.content == "hello"

    monkeypatch.setenv("LC_OUTPUT_VERSION", "v1")
    llm = GenericFakeChatModel(messages=iter(messages))
    response = llm.invoke("hello")
    assert response.content == [{"type": "text", "text": "hello"}]
    assert response.response_metadata["output_version"] == "v1"

Subdomains

Frequently Asked Questions

What does test_output_version_invoke() do?
test_output_version_invoke() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/language_models/chat_models/test_base.py.
Where is test_output_version_invoke() defined?
test_output_version_invoke() is defined in libs/core/tests/unit_tests/language_models/chat_models/test_base.py at line 879.

Analyze Your Own Codebase

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

Try Supermodel Free