import inspect
import asyncio


def convert_gen_to_async(gen, delay):
    """Convert a regular generator into an async generator by delaying between items"""
    assert inspect.isgenerator(gen)

    async def inner_async_gen():
        for value in gen:
            yield value
            await asyncio.sleep(delay)

    return inner_async_gen