Home / Function/ test_convert_to_openai_messages_json() — langchain Function Reference

test_convert_to_openai_messages_json() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  91d38715_6c2b_b321_b5b4_0ca92a0ea67d["test_convert_to_openai_messages_json()"]
  ea3f8d89_f44b_6738_3cb9_a740a73cfca4["test_utils.py"]
  91d38715_6c2b_b321_b5b4_0ca92a0ea67d -->|defined in| ea3f8d89_f44b_6738_3cb9_a740a73cfca4
  style 91d38715_6c2b_b321_b5b4_0ca92a0ea67d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 1253–1258

def test_convert_to_openai_messages_json() -> None:
    json_data = {"key": "value"}
    messages = [HumanMessage(content=[{"type": "json", "json": json_data}])]
    result = convert_to_openai_messages(messages, text_format="block")
    assert result[0]["content"][0]["type"] == "text"
    assert json.loads(result[0]["content"][0]["text"]) == json_data

Subdomains

Frequently Asked Questions

What does test_convert_to_openai_messages_json() do?
test_convert_to_openai_messages_json() 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_json() defined?
test_convert_to_openai_messages_json() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1253.

Analyze Your Own Codebase

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

Try Supermodel Free