import { AsyncLocalStorage } from "@llamaindex/env";
const chunkSizeAsyncLocalStorage = new AsyncLocalStorage();
const globalChunkSize = null;
export function getChunkSize() {
    return globalChunkSize ?? chunkSizeAsyncLocalStorage.getStore();
}
export function setChunkSize(chunkSize) {
    chunkSizeAsyncLocalStorage.enterWith(chunkSize);
}
export function withChunkSize(embeddedModel, fn) {
    return chunkSizeAsyncLocalStorage.run(embeddedModel, fn);
}
