Home / Function/ test_convert_to_openai_messages_openai_block() — langchain Function Reference

test_convert_to_openai_messages_openai_block() — langchain Function Reference

Architecture documentation for the test_convert_to_openai_messages_openai_block() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  42a1bd02_a80c_e88e_d827_1956cc5260cd["test_convert_to_openai_messages_openai_block()"]
  03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"]
  42a1bd02_a80c_e88e_d827_1956cc5260cd -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea
  style 42a1bd02_a80c_e88e_d827_1956cc5260cd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 1027–1034

def test_convert_to_openai_messages_openai_block() -> None:
    messages = [HumanMessage(content="Hello"), AIMessage(content="Hi there")]
    result = convert_to_openai_messages(messages, text_format="block")
    expected = [
        {"role": "user", "content": [{"type": "text", "text": "Hello"}]},
        {"role": "assistant", "content": [{"type": "text", "text": "Hi there"}]},
    ]
    assert result == expected

Domain

Subdomains

Frequently Asked Questions

What does test_convert_to_openai_messages_openai_block() do?
test_convert_to_openai_messages_openai_block() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_convert_to_openai_messages_openai_block() defined?
test_convert_to_openai_messages_openai_block() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1027.

Analyze Your Own Codebase

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

Try Supermodel Free