I want to persist an index to storage (directory). I also want to be able to load that index from storage when I rerun my script.
But what happens on the first run, when no index has been created? what will
load_index_from_storage(storage_context)
return?
In other words, I want to:
index = load_index_from_storage(storage_context)
if(#WHEN INDEX IS NOT TRUTHY / ON FIRST RUN#):
index = ListIndex.from_defaults(...)
index.persist()
so I can load the index, or create it on first run.
Suggestions?