test_default_aadd_documents() — langchain Function Reference
Architecture documentation for the test_default_aadd_documents() function in test_vectorstore.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD bcd4fa36_6803_19da_3128_dc82bde52308["test_default_aadd_documents()"] 547b9326_0fd1_ea2c_f15c_82026f35f74c["test_vectorstore.py"] bcd4fa36_6803_19da_3128_dc82bde52308 -->|defined in| 547b9326_0fd1_ea2c_f15c_82026f35f74c style bcd4fa36_6803_19da_3128_dc82bde52308 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/vectorstores/test_vectorstore.py lines 184–205
async def test_default_aadd_documents(vs_class: type[VectorStore]) -> None:
"""Test delegation to the synchronous method."""
store = vs_class()
# Check upsert with id
assert await store.aadd_documents([Document(id="1", page_content="hello")]) == ["1"]
assert await store.aget_by_ids(["1"]) == [Document(id="1", page_content="hello")]
# Check upsert without id
ids = await store.aadd_documents([Document(page_content="world")])
assert len(ids) == 1
assert await store.aget_by_ids(ids) == [Document(id=ids[0], page_content="world")]
# Check that add_documents works
assert await store.aadd_documents([Document(id="5", page_content="baz")]) == ["5"]
# Test add documents with id specified in both document and ids
original_document = Document(id="7", page_content="baz")
assert await store.aadd_documents([original_document], ids=["6"]) == ["6"]
assert original_document.id == "7" # original document should not be modified
assert await store.aget_by_ids(["6"]) == [Document(id="6", page_content="baz")]
Domain
Subdomains
Source
Frequently Asked Questions
What does test_default_aadd_documents() do?
test_default_aadd_documents() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/vectorstores/test_vectorstore.py.
Where is test_default_aadd_documents() defined?
test_default_aadd_documents() is defined in libs/core/tests/unit_tests/vectorstores/test_vectorstore.py at line 184.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free