"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    getChunkSize: function() {
        return getChunkSize;
    },
    setChunkSize: function() {
        return setChunkSize;
    },
    withChunkSize: function() {
        return withChunkSize;
    }
});
const _env = require("@llamaindex/env");
const chunkSizeAsyncLocalStorage = new _env.AsyncLocalStorage();
const globalChunkSize = null;
function getChunkSize() {
    return globalChunkSize ?? chunkSizeAsyncLocalStorage.getStore();
}
function setChunkSize(chunkSize) {
    chunkSizeAsyncLocalStorage.enterWith(chunkSize);
}
function withChunkSize(embeddedModel, fn) {
    return chunkSizeAsyncLocalStorage.run(embeddedModel, fn);
}
