1 |
- {"ast":null,"code":"import _awaitAsyncGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js\";\nimport _wrapAsyncGenerator from \"F:/workspace/202226701027/huinongbao-app/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js\";\nimport { AsyncLocalStorageProviderSingleton } from \"../singletons/index.js\";\nexport function isIterableIterator(thing) {\n return typeof thing === \"object\" && thing !== null && typeof thing[Symbol.iterator] === \"function\" &&\n // avoid detecting array/set as iterator\n typeof thing.next === \"function\";\n}\nexport const isIterator = x => x != null && typeof x === \"object\" && \"next\" in x && typeof x.next === \"function\";\nexport function isAsyncIterable(thing) {\n return typeof thing === \"object\" && thing !== null && typeof thing[Symbol.asyncIterator] === \"function\";\n}\nexport function* consumeIteratorInContext(context, iter) {\n while (true) {\n const {\n value,\n done\n } = AsyncLocalStorageProviderSingleton.runWithConfig(context, iter.next.bind(iter), true);\n if (done) {\n break;\n } else {\n yield value;\n }\n }\n}\nexport function consumeAsyncIterableInContext(_x, _x2) {\n return _consumeAsyncIterableInContext.apply(this, arguments);\n}\nfunction _consumeAsyncIterableInContext() {\n _consumeAsyncIterableInContext = _wrapAsyncGenerator(function* (context, iter) {\n const iterator = iter[Symbol.asyncIterator]();\n while (true) {\n const {\n value,\n done\n } = yield _awaitAsyncGenerator(AsyncLocalStorageProviderSingleton.runWithConfig(context, iterator.next.bind(iter), true));\n if (done) {\n break;\n } else {\n yield value;\n }\n }\n });\n return _consumeAsyncIterableInContext.apply(this, arguments);\n}","map":{"version":3,"names":["AsyncLocalStorageProviderSingleton","isIterableIterator","thing","Symbol","iterator","next","isIterator","x","isAsyncIterable","asyncIterator","consumeIteratorInContext","context","iter","value","done","runWithConfig","bind","consumeAsyncIterableInContext","_x","_x2","_consumeAsyncIterableInContext","apply","arguments","_wrapAsyncGenerator","_awaitAsyncGenerator"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@langchain/core/dist/runnables/iter.js"],"sourcesContent":["import { AsyncLocalStorageProviderSingleton } from \"../singletons/index.js\";\nexport function isIterableIterator(thing) {\n return (typeof thing === \"object\" &&\n thing !== null &&\n typeof thing[Symbol.iterator] === \"function\" &&\n // avoid detecting array/set as iterator\n typeof thing.next === \"function\");\n}\nexport const isIterator = (x) => x != null &&\n typeof x === \"object\" &&\n \"next\" in x &&\n typeof x.next === \"function\";\nexport function isAsyncIterable(thing) {\n return (typeof thing === \"object\" &&\n thing !== null &&\n typeof thing[Symbol.asyncIterator] ===\n \"function\");\n}\nexport function* consumeIteratorInContext(context, iter) {\n while (true) {\n const { value, done } = AsyncLocalStorageProviderSingleton.runWithConfig(context, iter.next.bind(iter), true);\n if (done) {\n break;\n }\n else {\n yield value;\n }\n }\n}\nexport async function* consumeAsyncIterableInContext(context, iter) {\n const iterator = iter[Symbol.asyncIterator]();\n while (true) {\n const { value, done } = await AsyncLocalStorageProviderSingleton.runWithConfig(context, iterator.next.bind(iter), true);\n if (done) {\n break;\n }\n else {\n yield value;\n }\n }\n}\n"],"mappings":";;AAAA,SAASA,kCAAkC,QAAQ,wBAAwB;AAC3E,OAAO,SAASC,kBAAkBA,CAACC,KAAK,EAAE;EACtC,OAAQ,OAAOA,KAAK,KAAK,QAAQ,IAC7BA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,CAACC,MAAM,CAACC,QAAQ,CAAC,KAAK,UAAU;EAC5C;EACA,OAAOF,KAAK,CAACG,IAAI,KAAK,UAAU;AACxC;AACA,OAAO,MAAMC,UAAU,GAAIC,CAAC,IAAKA,CAAC,IAAI,IAAI,IACtC,OAAOA,CAAC,KAAK,QAAQ,IACrB,MAAM,IAAIA,CAAC,IACX,OAAOA,CAAC,CAACF,IAAI,KAAK,UAAU;AAChC,OAAO,SAASG,eAAeA,CAACN,KAAK,EAAE;EACnC,OAAQ,OAAOA,KAAK,KAAK,QAAQ,IAC7BA,KAAK,KAAK,IAAI,IACd,OAAOA,KAAK,CAACC,MAAM,CAACM,aAA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