1 |
- {"ast":null,"code":"// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args) => fetch(...args);\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\"ls:fetch_implementation\");\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch functino to use.\n */\nexport const overrideFetchImplementation = fetch => {\n globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n/**\n * @internal\n */\nexport const _getFetchImplementation = () => {\n var _globalThis$LANGSMITH;\n return (_globalThis$LANGSMITH = globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY]) !== null && _globalThis$LANGSMITH !== void 0 ? _globalThis$LANGSMITH : DEFAULT_FETCH_IMPLEMENTATION;\n};","map":{"version":3,"names":["DEFAULT_FETCH_IMPLEMENTATION","args","fetch","LANGSMITH_FETCH_IMPLEMENTATION_KEY","Symbol","for","overrideFetchImplementation","globalThis","_getFetchImplementation","_globalThis$LANGSMITH"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/langsmith/dist/singletons/fetch.js"],"sourcesContent":["// Wrap the default fetch call due to issues with illegal invocations\n// in some environments:\n// https://stackoverflow.com/questions/69876859/why-does-bind-fix-failed-to-execute-fetch-on-window-illegal-invocation-err\n// @ts-expect-error Broad typing to support a range of fetch implementations\nconst DEFAULT_FETCH_IMPLEMENTATION = (...args) => fetch(...args);\nconst LANGSMITH_FETCH_IMPLEMENTATION_KEY = Symbol.for(\"ls:fetch_implementation\");\n/**\n * Overrides the fetch implementation used for LangSmith calls.\n * You should use this if you need to use an implementation of fetch\n * other than the default global (e.g. for dealing with proxies).\n * @param fetch The new fetch functino to use.\n */\nexport const overrideFetchImplementation = (fetch) => {\n globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] = fetch;\n};\n/**\n * @internal\n */\nexport const _getFetchImplementation = () => {\n return (globalThis[LANGSMITH_FETCH_IMPLEMENTATION_KEY] ??\n DEFAULT_FETCH_IMPLEMENTATION);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,MAAMA,4BAA4B,GAAGA,CAAC,GAAGC,IAAI,KAAKC,KAAK,CAAC,GAAGD,IAAI,CAAC;AAChE,MAAME,kCAAkC,GAAGC,MAAM,CAACC,GAAG,CAAC,yBAAyB,CAAC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,2BAA2B,GAAIJ,KAAK,IAAK;EAClDK,UAAU,CAACJ,kCAAkC,CAAC,GAAGD,KAAK;AAC1D,CAAC;AACD;AACA;AACA;AACA,OAAO,MAAMM,uBAAuB,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA;EACzC,QAAAA,qBAAA,GAAQF,UAAU,CAACJ,kCAAkC,CAAC,cAAAM,qBAAA,cAAAA,qBAAA,GAClDT,4BAA4B;AACpC,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|