Skip to content

Instantly share code, notes, and snippets.

@davidmezzetti
Last active August 18, 2021 14:32
Show Gist options
  • Save davidmezzetti/9a4cb4fe9a4c69bbca70f0e9792dfa96 to your computer and use it in GitHub Desktop.
Save davidmezzetti/9a4cb4fe9a4c69bbca70f0e9792dfa96 to your computer and use it in GitHub Desktop.
# Run initial query
uid = embeddings.search("feel good story", 1)[0][0]
print("Initial: ", data[uid])
# Update data
data[0] = "See it: baby panda born"
embeddings.upsert([(0, data[0], None)])
uid = embeddings.search("feel good story", 1)[0][0]
print("After update: ", data[uid])
# Remove record just added from index
embeddings.delete([0])
# Ensure value matches previous value
uid = embeddings.search("feel good story", 1)[0][0]
print("After delete: ", data[uid])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment