22import  pytest 
33
44from  langchain .schema  import  Document 
5- from  langchain .vectorstores .in_memory  import  InMemory 
5+ from  langchain .vectorstores .in_memory_exact_search  import  InMemoryExactSearch 
66from  tests .integration_tests .vectorstores .fake_embeddings  import  FakeEmbeddings 
77
88
99def  test_in_memory_vec_store_from_texts () ->  None :
1010    """Test end to end construction and simple similarity search.""" 
1111    texts  =  ["foo" , "bar" , "baz" ]
12-     docsearch  =  InMemory .from_texts (
12+     docsearch  =  InMemoryExactSearch .from_texts (
1313        texts ,
1414        FakeEmbeddings (),
1515    )
16-     assert  isinstance (docsearch , InMemory )
16+     assert  isinstance (docsearch , InMemoryExactSearch )
1717    assert  docsearch .doc_index .num_docs () ==  3 
1818
1919
2020def  test_in_memory_vec_store_add_texts (tmp_path ) ->  None :
2121    """Test end to end construction and simple similarity search.""" 
22-     docsearch  =  InMemory (
22+     docsearch  =  InMemoryExactSearch (
2323        embedding = FakeEmbeddings (),
2424    )
25-     assert  isinstance (docsearch , InMemory )
25+     assert  isinstance (docsearch , InMemoryExactSearch )
2626    assert  docsearch .doc_index .num_docs () ==  0 
2727
2828    texts  =  ["foo" , "bar" , "baz" ]
@@ -34,7 +34,7 @@ def test_in_memory_vec_store_add_texts(tmp_path) -> None:
3434def  test_sim_search (metric ) ->  None :
3535    """Test end to end construction and simple similarity search.""" 
3636    texts  =  ["foo" , "bar" , "baz" ]
37-     in_memory_vec_store  =  InMemory .from_texts (
37+     in_memory_vec_store  =  InMemoryExactSearch .from_texts (
3838        texts = texts ,
3939        embedding = FakeEmbeddings (),
4040        metric = metric ,
@@ -48,7 +48,7 @@ def test_sim_search(metric) -> None:
4848def  test_sim_search_with_score (metric ) ->  None :
4949    """Test end to end construction and similarity search with score.""" 
5050    texts  =  ["foo" , "bar" , "baz" ]
51-     in_memory_vec_store  =  InMemory .from_texts (
51+     in_memory_vec_store  =  InMemoryExactSearch .from_texts (
5252        texts = texts ,
5353        embedding = FakeEmbeddings (),
5454        metric = metric ,
@@ -67,7 +67,7 @@ def test_sim_search_with_score(metric) -> None:
6767def  test_sim_search_by_vector (metric ) ->  None :
6868    """Test end to end construction and similarity search by vector.""" 
6969    texts  =  ["foo" , "bar" , "baz" ]
70-     in_memory_vec_store  =  InMemory .from_texts (
70+     in_memory_vec_store  =  InMemoryExactSearch .from_texts (
7171        texts = texts ,
7272        embedding = FakeEmbeddings (),
7373        metric = metric ,
@@ -84,7 +84,7 @@ def test_max_marginal_relevance_search(metric) -> None:
8484    """Test MRR search.""" 
8585    texts  =  ["foo" , "bar" , "baz" ]
8686    metadatas  =  [{"page" : i } for  i  in  range (len (texts ))]
87-     docsearch  =  InMemory .from_texts (
87+     docsearch  =  InMemoryExactSearch .from_texts (
8888        texts ,
8989        FakeEmbeddings (),
9090        metadatas = metadatas ,
0 commit comments