# # Automatically restart kernel after installs so that your environment can access the new packages# import IPython# app = IPython.Application.instance()# app.kernel.do_shutdown(True)
# @markdown Please fill in the value below with your Google Cloud project ID and then run the cell.PROJECT_ID = "my-project-id" # @param {type:"string"}# Set the project id!gcloud config set project {PROJECT_ID}
import uuidall_texts = ["Apples and oranges", "Cars and airplanes", "Pineapple", "Train", "Banana"]metadatas = [{"len": len(t)} for t in all_texts]ids = [str(uuid.uuid4()) for _ in all_texts]await store.aadd_texts(all_texts, metadatas=metadatas, ids=ids)
import uuid# Add texts to the Vector Storeall_texts = ["Apples and oranges", "Cars and airplanes", "Pineapple", "Train", "Banana"]metadatas = [{"len": len(t)} for t in all_texts]ids = [str(uuid.uuid4()) for _ in all_texts]await store.aadd_texts(all_texts, metadatas=metadatas, ids=ids)# Use filter on searchdocs = await custom_store.asimilarity_search_by_vector(query_vector, filter="len >= 6")print(docs)