Home / Function/ test_multiple_items_async() — langchain Function Reference

test_multiple_items_async() — langchain Function Reference

Architecture documentation for the test_multiple_items_async() function in test_list_parser.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5a8cd71d_3c81_3d67_8a90_0fa0ca80de8f["test_multiple_items_async()"]
  8ae9f33a_614d_1533_e9a3_2a17ed09b1eb["test_list_parser.py"]
  5a8cd71d_3c81_3d67_8a90_0fa0ca80de8f -->|defined in| 8ae9f33a_614d_1533_e9a3_2a17ed09b1eb
  f45af033_8079_c0a8_ac59_5f1904e58d19["aiter_from_iter()"]
  5a8cd71d_3c81_3d67_8a90_0fa0ca80de8f -->|calls| f45af033_8079_c0a8_ac59_5f1904e58d19
  style 5a8cd71d_3c81_3d67_8a90_0fa0ca80de8f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/output_parsers/test_list_parser.py lines 201–228

async def test_multiple_items_async() -> None:
    """Test that a string with multiple comma-separated items is parsed to a list."""
    parser = CommaSeparatedListOutputParser()
    text = "foo, bar, baz"
    expected = ["foo", "bar", "baz"]

    assert await parser.aparse(text) == expected
    assert await aadd(parser.atransform(aiter_from_iter(t for t in text))) == expected
    assert [a async for a in parser.atransform(aiter_from_iter(t for t in text))] == [
        [a] for a in expected
    ]
    assert [
        a
        async for a in parser.atransform(
            aiter_from_iter(t for t in text.splitlines(keepends=True))
        )
    ] == [[a] for a in expected]
    assert [
        a
        async for a in parser.atransform(
            aiter_from_iter(
                " " + t if i > 0 else t for i, t in enumerate(text.split(" "))
            )
        )
    ] == [[a] for a in expected]
    assert [a async for a in parser.atransform(aiter_from_iter([text]))] == [
        [a] for a in expected
    ]

Subdomains

Frequently Asked Questions

What does test_multiple_items_async() do?
test_multiple_items_async() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py.
Where is test_multiple_items_async() defined?
test_multiple_items_async() is defined in libs/core/tests/unit_tests/output_parsers/test_list_parser.py at line 201.
What does test_multiple_items_async() call?
test_multiple_items_async() calls 1 function(s): aiter_from_iter.

Analyze Your Own Codebase

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

Try Supermodel Free