import { randomUUID } from "@llamaindex/env";
/**
 * The underlying structure of each index.
 */ export class IndexStruct {
    indexId;
    summary;
    constructor(indexId = randomUUID(), summary = undefined){
        this.indexId = indexId;
        this.summary = summary;
    }
    toJson() {
        return {
            indexId: this.indexId,
            summary: this.summary
        };
    }
    getSummary() {
        if (this.summary === undefined) {
            throw new Error("summary field of the index dict is not set");
        }
        return this.summary;
    }
}
