async def test_vector_memory_block_put(vector_memory_block):
    """Test putting messages in the vector memory block."""
    # Create messages
    messages = [
        ChatMessage(role="user", content="Hello, how are you?"),
        ChatMessage(role="assistant", content="I'm doing well, thank you for asking!"),
    ]

    # Put messages in memory
    await vector_memory_block.aput(messages=messages)

    # Check that messages were added to vector store
    assert len(vector_memory_block.vector_store.nodes) == 1

    # Check node content contains both messages
    node = next(iter(vector_memory_block.vector_store.nodes.values()))
    assert "<message role='user'>Hello, how are you?</message>" in node.text
    assert (
        "<message role='assistant'>I'm doing well, thank you for asking!</message>"
        in node.text
    )
Test putting messages in the vector memory block.
llama-index-core/tests/memory/blocks/test_vector.py