Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
storage.ts 536 B
import { storageContextFromDefaults } from "llamaindex";

// set up store context with two vector stores, one for text, the other for images
export async function getStorageContext() {
  return await storageContextFromDefaults({
    persistDir: "storage",
    storeImages: true,
    // if storeImages is true, the following vector store will be added
    // vectorStores: {
    //   IMAGE: SimpleVectorStore.fromPersistDir(
    //     `${persistDir}/images`,
    //     fs,
    //     new ClipEmbedding(),
    //   ),
    // },
  });
}