code: from datetime import datetime
  
  import lancedb
  from langchain.embeddings.base import Embeddings
  from langchain.vectorstores import VectorStore, LanceDB
  
  from config import Config
  from utils.files import get_root_path
  
  
  def get_vectorstore(table_name: str, embedding: Embeddings) -> VectorStore:
      config = Config()
      db_path = get_root_path() / config.lancedb_url
      db = lancedb.connect(db_path)
      if not table_name in db.table_names():
          table = db.create_table(table_name, data=[
              {
                  "vector": embedding.embed_query("Hello World"),
                  "text": "Hello World",
                  "url": "https://google.com/",
                  "time": datetime.now().timestamp()}
          ])
      else:
          table = db.open_table(table_name)
  
      vectorstore = LanceDB(embedding=embedding, connection=table)
  
      return vectorstore
apis: lancedb.connect
extract_api: [((307, 315), 'config.Config', 'Config', ([], {}), '()\n', (313, 315), False, 'from config import Config\n'), ((376, 400), 'lancedb.connect', 'lancedb.connect', (['db_path'], {}), '(db_path)\n', (391, 400), False, 'import lancedb\n'), ((792, 838), 'langchain.vectorstores.LanceDB', 'LanceDB', ([], {'embedding': 'embedding', 'connection': 'table'}), '(embedding=embedding, connection=table)\n', (799, 838), False, 'from langchain.vectorstores import VectorStore, LanceDB\n'), ((330, 345), 'utils.files.get_root_path', 'get_root_path', ([], {}), '()\n', (343, 345), False, 'from utils.files import get_root_path\n'), ((682, 696), 'datetime.datetime.now', 'datetime.now', ([], {}), '()\n', (694, 696), False, 'from datetime import datetime\n')]