def mock_providers():
    """
    Return a fake R2RProviders object with all relevant sub-providers mocked.
    """

    class MockProviders:
        def __init__(self):
            # Mock the embedding provider
            self.completion_embedding = AsyncMock()
            self.completion_embedding.async_get_embedding = AsyncMock(
                return_value=[0.123] * 768  # pretend vector
            )
            self.completion_embedding.arerank = AsyncMock(return_value=[])

            # Mock the chunk search provider
            self.database = AsyncMock()
            self.database.chunks_handler.hybrid_search = AsyncMock(
                return_value=[]
            )
            self.database.chunks_handler.semantic_search = AsyncMock(
                return_value=[]
            )
            self.database.chunks_handler.full_text_search = AsyncMock(
                return_value=[]
            )

            # Mock the graph search
            self.database.graphs_handler.graph_search = AsyncMock(
                return_value=iter([])
            )

            # Optional: If you want to test agent logic, mock those too
            self.llm = AsyncMock()
            self.llm.aget_completion = AsyncMock()
            self.llm.aget_completion_stream = AsyncMock()

            self.database.prompts_handler.get_cached_prompt = AsyncMock(
                return_value="(fake hyde template here)"
            )

    return MockProviders()

    Return a fake R2RProviders object with all relevant sub-providers mocked.
    
py/tests/unit/retrieval/test_retrieval_old.py