code: from langchain_community.vectorstores import LanceDB
  from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings
  
  
  def test_lancedb() -> None:
      import lancedb
  
      embeddings = FakeEmbeddings()
      db = lancedb.connect("/tmp/lancedb")
      texts = ["text 1", "text 2", "item 3"]
      vectors = embeddings.embed_documents(texts)
      table = db.create_table(
          "my_table",
          data=[
              {"vector": vectors[idx], "id": text, "text": text}
              for idx, text in enumerate(texts)
          ],
          mode="overwrite",
      )
      store = LanceDB(table, embeddings)
      result = store.similarity_search("text 1")
      result_texts = [doc.page_content for doc in result]
      assert "text 1" in result_texts
  
  
  def test_lancedb_add_texts() -> None:
      import lancedb
  
      embeddings = FakeEmbeddings()
      db = lancedb.connect("/tmp/lancedb")
      texts = ["text 1"]
      vectors = embeddings.embed_documents(texts)
      table = db.create_table(
          "my_table",
          data=[
              {"vector": vectors[idx], "id": text, "text": text}
              for idx, text in enumerate(texts)
          ],
          mode="overwrite",
      )
      store = LanceDB(table, embeddings)
      store.add_texts(["text 2"])
      result = store.similarity_search("text 2")
      result_texts = [doc.page_content for doc in result]
      assert "text 2" in result_texts
  
apis: lancedb.connect
extract_api: [((200, 216), 'tests.integration_tests.vectorstores.fake_embeddings.FakeEmbeddings', 'FakeEmbeddings', ([], {}), '()\n', (214, 216), False, 'from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings\n'), ((226, 257), 'lancedb.connect', 'lancedb.connect', (['"""/tmp/lancedb"""'], {}), "('/tmp/lancedb')\n", (241, 257), False, 'import lancedb\n'), ((577, 603), 'langchain_community.vectorstores.LanceDB', 'LanceDB', (['table', 'embeddings'], {}), '(table, embeddings)\n', (584, 603), False, 'from langchain_community.vectorstores import LanceDB\n'), ((820, 836), 'tests.integration_tests.vectorstores.fake_embeddings.FakeEmbeddings', 'FakeEmbeddings', ([], {}), '()\n', (834, 836), False, 'from tests.integration_tests.vectorstores.fake_embeddings import FakeEmbeddings\n'), ((846, 877), 'lancedb.connect', 'lancedb.connect', (['"""/tmp/lancedb"""'], {}), "('/tmp/lancedb')\n", (861, 877), False, 'import lancedb\n'), ((1177, 1203), 'langchain_community.vectorstores.LanceDB', 'LanceDB', (['table', 'embeddings'], {}), '(table, embeddings)\n', (1184, 1203), False, 'from langchain_community.vectorstores import LanceDB\n')]