langgraph-ui-components 0.0.10 → 0.0.11-testing
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +3 -2
- package/dist/index.es10.js +25 -6
- package/dist/index.es10.js.map +1 -1
- package/dist/index.es100.js +131 -64
- package/dist/index.es100.js.map +1 -1
- package/dist/index.es101.js +65 -32
- package/dist/index.es101.js.map +1 -1
- package/dist/index.es102.js +34 -34
- package/dist/index.es102.js.map +1 -1
- package/dist/index.es103.js +35 -164
- package/dist/index.es103.js.map +1 -1
- package/dist/index.es104.js +156 -193
- package/dist/index.es104.js.map +1 -1
- package/dist/index.es105.js +202 -13
- package/dist/index.es105.js.map +1 -1
- package/dist/index.es106.js +13 -29
- package/dist/index.es106.js.map +1 -1
- package/dist/index.es107.js +25 -29
- package/dist/index.es107.js.map +1 -1
- package/dist/index.es108.js +24 -3147
- package/dist/index.es108.js.map +1 -1
- package/dist/index.es109.js +3151 -31
- package/dist/index.es109.js.map +1 -1
- package/dist/index.es110.js +21 -5
- package/dist/index.es110.js.map +1 -1
- package/dist/index.es111.js +64 -69
- package/dist/index.es111.js.map +1 -1
- package/dist/index.es112.js +3 -37
- package/dist/index.es112.js.map +1 -1
- package/dist/index.es113.js +16 -5
- package/dist/index.es113.js.map +1 -1
- package/dist/index.es114.js +7 -2
- package/dist/index.es114.js.map +1 -1
- package/dist/index.es115.js +2 -13
- package/dist/index.es115.js.map +1 -1
- package/dist/index.es116.js +9 -499
- package/dist/index.es116.js.map +1 -1
- package/dist/index.es117.js +501 -5
- package/dist/index.es117.js.map +1 -1
- package/dist/index.es118.js +7 -2
- package/dist/index.es118.js.map +1 -1
- package/dist/index.es119.js +2 -148
- package/dist/index.es119.js.map +1 -1
- package/dist/index.es120.js +118 -878
- package/dist/index.es120.js.map +1 -1
- package/dist/index.es121.js +877 -251
- package/dist/index.es121.js.map +1 -1
- package/dist/index.es122.js +281 -3
- package/dist/index.es122.js.map +1 -1
- package/dist/index.es123.js +3 -445
- package/dist/index.es123.js.map +1 -1
- package/dist/index.es124.js +437 -39
- package/dist/index.es124.js.map +1 -1
- package/dist/index.es125.js +46 -22
- package/dist/index.es125.js.map +1 -1
- package/dist/index.es126.js +21 -78
- package/dist/index.es126.js.map +1 -1
- package/dist/index.es127.js +76 -126
- package/dist/index.es127.js.map +1 -1
- package/dist/index.es128.js +125 -45
- package/dist/index.es128.js.map +1 -1
- package/dist/index.es129.js +48 -9
- package/dist/index.es129.js.map +1 -1
- package/dist/index.es130.js +10 -45
- package/dist/index.es130.js.map +1 -1
- package/dist/index.es131.js +43 -97
- package/dist/index.es131.js.map +1 -1
- package/dist/index.es132.js +94 -48
- package/dist/index.es132.js.map +1 -1
- package/dist/index.es133.js +51 -14
- package/dist/index.es133.js.map +1 -1
- package/dist/index.es134.js +1 -1
- package/dist/index.es135.js +1 -1
- package/dist/index.es138.js +1 -1
- package/dist/index.es139.js +1 -1
- package/dist/index.es140.js +1 -1
- package/dist/index.es141.js +1 -1
- package/dist/index.es142.js +1 -1
- package/dist/index.es143.js +1 -1
- package/dist/index.es144.js +1 -1
- package/dist/index.es145.js +1 -1
- package/dist/index.es146.js +1 -1
- package/dist/index.es147.js +1 -1
- package/dist/index.es148.js +1 -1
- package/dist/index.es149.js +1 -1
- package/dist/index.es150.js +1 -1
- package/dist/index.es151.js +1 -1
- package/dist/index.es152.js +1 -1
- package/dist/index.es153.js +1 -1
- package/dist/index.es154.js +1 -1
- package/dist/index.es155.js +1 -1
- package/dist/index.es156.js +1 -1
- package/dist/index.es157.js +1 -1
- package/dist/index.es158.js +1 -1
- package/dist/index.es159.js +1 -1
- package/dist/index.es16.js +3 -3
- package/dist/index.es16.js.map +1 -1
- package/dist/index.es160.js +1 -1
- package/dist/index.es161.js +1 -1
- package/dist/index.es162.js +1 -1
- package/dist/index.es163.js +1 -1
- package/dist/index.es164.js +1 -1
- package/dist/index.es165.js +1 -1
- package/dist/index.es166.js +1 -1
- package/dist/index.es167.js +1 -1
- package/dist/index.es168.js +1 -1
- package/dist/index.es169.js +1 -1
- package/dist/index.es170.js +1 -1
- package/dist/index.es171.js +1 -1
- package/dist/index.es172.js +1 -1
- package/dist/index.es173.js +1 -1
- package/dist/index.es174.js +1 -1
- package/dist/index.es175.js +1 -1
- package/dist/index.es176.js +1 -1
- package/dist/index.es177.js +1 -1
- package/dist/index.es178.js +1 -1
- package/dist/index.es179.js +1 -1
- package/dist/index.es18.js +15 -15
- package/dist/index.es180.js +1 -1
- package/dist/index.es181.js +1 -1
- package/dist/index.es182.js +1 -1
- package/dist/index.es183.js +162 -13
- package/dist/index.es183.js.map +1 -1
- package/dist/index.es184.js +2 -89
- package/dist/index.es184.js.map +1 -1
- package/dist/index.es185.js +15 -2
- package/dist/index.es185.js.map +1 -1
- package/dist/index.es186.js +89 -2
- package/dist/index.es186.js.map +1 -1
- package/dist/index.es187.js +2 -2
- package/dist/index.es188.js +56 -2
- package/dist/index.es188.js.map +1 -1
- package/dist/index.es189.js +100 -2
- package/dist/index.es189.js.map +1 -1
- package/dist/index.es190.js +191 -2
- package/dist/index.es190.js.map +1 -1
- package/dist/index.es191.js +110 -2
- package/dist/index.es191.js.map +1 -1
- package/dist/index.es192.js +35 -2
- package/dist/index.es192.js.map +1 -1
- package/dist/index.es193.js +10 -2
- package/dist/index.es193.js.map +1 -1
- package/dist/index.es194.js +11 -2
- package/dist/index.es194.js.map +1 -1
- package/dist/index.es195.js +12 -2
- package/dist/index.es195.js.map +1 -1
- package/dist/index.es196.js +91 -2
- package/dist/index.es196.js.map +1 -1
- package/dist/index.es197.js +275 -2
- package/dist/index.es197.js.map +1 -1
- package/dist/index.es198.js +2 -2
- package/dist/index.es199.js +164 -2
- package/dist/index.es199.js.map +1 -1
- package/dist/index.es200.js +51 -2
- package/dist/index.es200.js.map +1 -1
- package/dist/index.es201.js +40 -2
- package/dist/index.es201.js.map +1 -1
- package/dist/index.es202.js +35 -2
- package/dist/index.es202.js.map +1 -1
- package/dist/index.es203.js +40 -2
- package/dist/index.es203.js.map +1 -1
- package/dist/index.es204.js +24 -2
- package/dist/index.es204.js.map +1 -1
- package/dist/index.es205.js +591 -2
- package/dist/index.es205.js.map +1 -1
- package/dist/index.es206.js +125 -2
- package/dist/index.es206.js.map +1 -1
- package/dist/index.es207.js +2 -2
- package/dist/index.es208.js +2 -2
- package/dist/index.es209.js +2 -2
- package/dist/index.es210.js +2 -2
- package/dist/index.es211.js +2 -2
- package/dist/index.es212.js +2 -2
- package/dist/index.es213.js +2 -2
- package/dist/index.es214.js +2 -2
- package/dist/index.es215.js +2 -2
- package/dist/index.es216.js +2 -2
- package/dist/index.es217.js +2 -2
- package/dist/index.es218.js +2 -2
- package/dist/index.es219.js +2 -2
- package/dist/index.es220.js +2 -2
- package/dist/index.es221.js +2 -2
- package/dist/index.es222.js +2 -2
- package/dist/index.es223.js +2 -2
- package/dist/index.es224.js +2 -2
- package/dist/index.es225.js +2 -2
- package/dist/index.es226.js +2 -2
- package/dist/index.es227.js +2 -2
- package/dist/index.es228.js +2 -2
- package/dist/index.es229.js +2 -2
- package/dist/index.es230.js +2 -2
- package/dist/index.es231.js +2 -56
- package/dist/index.es231.js.map +1 -1
- package/dist/index.es232.js +2 -100
- package/dist/index.es232.js.map +1 -1
- package/dist/index.es233.js +2 -191
- package/dist/index.es233.js.map +1 -1
- package/dist/index.es234.js +2 -110
- package/dist/index.es234.js.map +1 -1
- package/dist/index.es235.js +2 -35
- package/dist/index.es235.js.map +1 -1
- package/dist/index.es236.js +2 -10
- package/dist/index.es236.js.map +1 -1
- package/dist/index.es237.js +2 -11
- package/dist/index.es237.js.map +1 -1
- package/dist/index.es238.js +2 -12
- package/dist/index.es238.js.map +1 -1
- package/dist/index.es239.js +2 -91
- package/dist/index.es239.js.map +1 -1
- package/dist/index.es24.js +1 -1
- package/dist/index.es240.js +2 -275
- package/dist/index.es240.js.map +1 -1
- package/dist/index.es241.js +2 -2
- package/dist/index.es242.js +2 -164
- package/dist/index.es242.js.map +1 -1
- package/dist/index.es243.js +2 -51
- package/dist/index.es243.js.map +1 -1
- package/dist/index.es244.js +2 -40
- package/dist/index.es244.js.map +1 -1
- package/dist/index.es245.js +2 -35
- package/dist/index.es245.js.map +1 -1
- package/dist/index.es246.js +2 -40
- package/dist/index.es246.js.map +1 -1
- package/dist/index.es247.js +2 -24
- package/dist/index.es247.js.map +1 -1
- package/dist/index.es248.js +2 -591
- package/dist/index.es248.js.map +1 -1
- package/dist/index.es249.js +2 -125
- package/dist/index.es249.js.map +1 -1
- package/dist/index.es25.js +3 -1
- package/dist/index.es25.js.map +1 -1
- package/dist/index.es250.js +2 -164
- package/dist/index.es250.js.map +1 -1
- package/dist/index.es251.js +2 -2
- package/dist/index.es252.js +2 -2
- package/dist/index.es253.js +1 -1
- package/dist/index.es258.js +1 -1
- package/dist/index.es260.js +2 -2
- package/dist/index.es262.js +2 -2
- package/dist/index.es265.js +1 -1
- package/dist/index.es267.js +1 -1
- package/dist/index.es277.js +2 -147
- package/dist/index.es277.js.map +1 -1
- package/dist/index.es278.js +126 -167
- package/dist/index.es278.js.map +1 -1
- package/dist/index.es279.js +188 -2
- package/dist/index.es279.js.map +1 -1
- package/dist/index.es280.js +1 -1
- package/dist/index.es283.js +1 -1
- package/dist/index.es288.js +1 -1
- package/dist/index.es29.js +1 -1
- package/dist/index.es3.js +24 -9
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es300.js +1 -1
- package/dist/index.es302.js +1 -1
- package/dist/index.es31.js +7 -7
- package/dist/index.es314.js +1 -1
- package/dist/index.es32.js +1 -1
- package/dist/index.es334.js +2 -2
- package/dist/index.es35.js +4 -4
- package/dist/index.es36.js +1185 -111
- package/dist/index.es36.js.map +1 -1
- package/dist/index.es37.js +7 -71
- package/dist/index.es37.js.map +1 -1
- package/dist/index.es38.js +9 -18
- package/dist/index.es38.js.map +1 -1
- package/dist/index.es39.js +136 -250
- package/dist/index.es39.js.map +1 -1
- package/dist/index.es4.js +2 -1
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es40.js +116 -41
- package/dist/index.es40.js.map +1 -1
- package/dist/index.es41.js +64 -208
- package/dist/index.es41.js.map +1 -1
- package/dist/index.es42.js +17 -66
- package/dist/index.es42.js.map +1 -1
- package/dist/index.es43.js +236 -117
- package/dist/index.es43.js.map +1 -1
- package/dist/index.es44.js +38 -19
- package/dist/index.es44.js.map +1 -1
- package/dist/index.es45.js +202 -217
- package/dist/index.es45.js.map +1 -1
- package/dist/index.es46.js +65 -7
- package/dist/index.es46.js.map +1 -1
- package/dist/index.es47.js +131 -1181
- package/dist/index.es47.js.map +1 -1
- package/dist/index.es48.js +25 -8
- package/dist/index.es48.js.map +1 -1
- package/dist/index.es49.js +218 -135
- package/dist/index.es49.js.map +1 -1
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es50.js +5 -208
- package/dist/index.es50.js.map +1 -1
- package/dist/index.es51.js +208 -5
- package/dist/index.es51.js.map +1 -1
- package/dist/index.es52.js +90 -7
- package/dist/index.es52.js.map +1 -1
- package/dist/index.es53.js +6 -92
- package/dist/index.es53.js.map +1 -1
- package/dist/index.es54.js +14 -3
- package/dist/index.es54.js.map +1 -1
- package/dist/index.es55.js +8 -36
- package/dist/index.es55.js.map +1 -1
- package/dist/index.es56.js +83 -61
- package/dist/index.es56.js.map +1 -1
- package/dist/index.es57.js +3 -37
- package/dist/index.es57.js.map +1 -1
- package/dist/index.es58.js +34 -304
- package/dist/index.es58.js.map +1 -1
- package/dist/index.es59.js +72 -9
- package/dist/index.es59.js.map +1 -1
- package/dist/index.es60.js +32 -85
- package/dist/index.es60.js.map +1 -1
- package/dist/index.es61.js +304 -6
- package/dist/index.es61.js.map +1 -1
- package/dist/index.es62.js +9 -15
- package/dist/index.es62.js.map +1 -1
- package/dist/index.es63.js +3 -3
- package/dist/index.es64.js +5 -142
- package/dist/index.es64.js.map +1 -1
- package/dist/index.es65.js +148 -285
- package/dist/index.es65.js.map +1 -1
- package/dist/index.es66.js +668 -62
- package/dist/index.es66.js.map +1 -1
- package/dist/index.es67.js +131 -201
- package/dist/index.es67.js.map +1 -1
- package/dist/index.es68.js +295 -29
- package/dist/index.es68.js.map +1 -1
- package/dist/index.es69.js +65 -8
- package/dist/index.es69.js.map +1 -1
- package/dist/index.es7.js +2 -1
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es70.js +210 -9
- package/dist/index.es70.js.map +1 -1
- package/dist/index.es71.js +28 -181
- package/dist/index.es71.js.map +1 -1
- package/dist/index.es72.js +8 -23
- package/dist/index.es72.js.map +1 -1
- package/dist/index.es73.js +9 -1397
- package/dist/index.es73.js.map +1 -1
- package/dist/index.es74.js +187 -9
- package/dist/index.es74.js.map +1 -1
- package/dist/index.es75.js +24 -8
- package/dist/index.es75.js.map +1 -1
- package/dist/index.es76.js +1399 -5
- package/dist/index.es76.js.map +1 -1
- package/dist/index.es77.js +9 -163
- package/dist/index.es77.js.map +1 -1
- package/dist/index.es78.js +8 -672
- package/dist/index.es78.js.map +1 -1
- package/dist/index.es79.js +36 -20
- package/dist/index.es79.js.map +1 -1
- package/dist/index.es80.js +5 -68
- package/dist/index.es80.js.map +1 -1
- package/dist/index.es81.js +73 -3
- package/dist/index.es81.js.map +1 -1
- package/dist/index.es82.js +36 -11
- package/dist/index.es82.js.map +1 -1
- package/dist/index.es83.js +10 -38
- package/dist/index.es83.js.map +1 -1
- package/dist/index.es84.js +34 -28
- package/dist/index.es84.js.map +1 -1
- package/dist/index.es85.js +28 -226
- package/dist/index.es85.js.map +1 -1
- package/dist/index.es86.js +228 -26
- package/dist/index.es86.js.map +1 -1
- package/dist/index.es87.js +26 -71
- package/dist/index.es87.js.map +1 -1
- package/dist/index.es88.js +41 -42
- package/dist/index.es88.js.map +1 -1
- package/dist/index.es89.js +71 -47
- package/dist/index.es89.js.map +1 -1
- package/dist/index.es90.js +37 -15
- package/dist/index.es90.js.map +1 -1
- package/dist/index.es91.js +6 -19
- package/dist/index.es91.js.map +1 -1
- package/dist/index.es92.js +40 -54
- package/dist/index.es92.js.map +1 -1
- package/dist/index.es93.js +56 -12
- package/dist/index.es93.js.map +1 -1
- package/dist/index.es94.js +13 -137
- package/dist/index.es94.js.map +1 -1
- package/dist/index.es95.js +135 -19
- package/dist/index.es95.js.map +1 -1
- package/dist/index.es96.js +18 -179
- package/dist/index.es96.js.map +1 -1
- package/dist/index.es97.js +163 -222
- package/dist/index.es97.js.map +1 -1
- package/dist/index.es98.js +187 -301
- package/dist/index.es98.js.map +1 -1
- package/dist/index.es99.js +348 -130
- package/dist/index.es99.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es233.js
CHANGED
|
@@ -1,194 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { BaseTracer } from "./index.es123.js";
|
|
3
|
-
import styles from "./index.es261.js";
|
|
4
|
-
var console_exports = {};
|
|
5
|
-
__export(console_exports, { ConsoleCallbackHandler: () => ConsoleCallbackHandler });
|
|
6
|
-
function wrap(style, text) {
|
|
7
|
-
return `${style.open}${text}${style.close}`;
|
|
8
|
-
}
|
|
9
|
-
function tryJsonStringify(obj, fallback) {
|
|
10
|
-
try {
|
|
11
|
-
return JSON.stringify(obj, null, 2);
|
|
12
|
-
} catch {
|
|
13
|
-
return fallback;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function formatKVMapItem(value) {
|
|
17
|
-
if (typeof value === "string") return value.trim();
|
|
18
|
-
if (value === null || value === void 0) return value;
|
|
19
|
-
return tryJsonStringify(value, value.toString());
|
|
20
|
-
}
|
|
21
|
-
function elapsed(run) {
|
|
22
|
-
if (!run.end_time) return "";
|
|
23
|
-
const elapsed$1 = run.end_time - run.start_time;
|
|
24
|
-
if (elapsed$1 < 1e3) return `${elapsed$1}ms`;
|
|
25
|
-
return `${(elapsed$1 / 1e3).toFixed(2)}s`;
|
|
26
|
-
}
|
|
27
|
-
const { color } = styles;
|
|
28
|
-
var ConsoleCallbackHandler = class extends BaseTracer {
|
|
29
|
-
name = "console_callback_handler";
|
|
30
|
-
/**
|
|
31
|
-
* Method used to persist the run. In this case, it simply returns a
|
|
32
|
-
* resolved promise as there's no persistence logic.
|
|
33
|
-
* @param _run The run to persist.
|
|
34
|
-
* @returns A resolved promise.
|
|
35
|
-
*/
|
|
36
|
-
persistRun(_run) {
|
|
37
|
-
return Promise.resolve();
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Method used to get all the parent runs of a given run.
|
|
41
|
-
* @param run The run whose parents are to be retrieved.
|
|
42
|
-
* @returns An array of parent runs.
|
|
43
|
-
*/
|
|
44
|
-
getParents(run) {
|
|
45
|
-
const parents = [];
|
|
46
|
-
let currentRun = run;
|
|
47
|
-
while (currentRun.parent_run_id) {
|
|
48
|
-
const parent = this.runMap.get(currentRun.parent_run_id);
|
|
49
|
-
if (parent) {
|
|
50
|
-
parents.push(parent);
|
|
51
|
-
currentRun = parent;
|
|
52
|
-
} else break;
|
|
53
|
-
}
|
|
54
|
-
return parents;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Method used to get a string representation of the run's lineage, which
|
|
58
|
-
* is used in logging.
|
|
59
|
-
* @param run The run whose lineage is to be retrieved.
|
|
60
|
-
* @returns A string representation of the run's lineage.
|
|
61
|
-
*/
|
|
62
|
-
getBreadcrumbs(run) {
|
|
63
|
-
const parents = this.getParents(run).reverse();
|
|
64
|
-
const string = [...parents, run].map((parent, i, arr) => {
|
|
65
|
-
const name = `${parent.execution_order}:${parent.run_type}:${parent.name}`;
|
|
66
|
-
return i === arr.length - 1 ? wrap(styles.bold, name) : name;
|
|
67
|
-
}).join(" > ");
|
|
68
|
-
return wrap(color.grey, string);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Method used to log the start of a chain run.
|
|
72
|
-
* @param run The chain run that has started.
|
|
73
|
-
* @returns void
|
|
74
|
-
*/
|
|
75
|
-
onChainStart(run) {
|
|
76
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
77
|
-
console.log(`${wrap(color.green, "[chain/start]")} [${crumbs}] Entering Chain run with input: ${tryJsonStringify(run.inputs, "[inputs]")}`);
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Method used to log the end of a chain run.
|
|
81
|
-
* @param run The chain run that has ended.
|
|
82
|
-
* @returns void
|
|
83
|
-
*/
|
|
84
|
-
onChainEnd(run) {
|
|
85
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
86
|
-
console.log(`${wrap(color.cyan, "[chain/end]")} [${crumbs}] [${elapsed(run)}] Exiting Chain run with output: ${tryJsonStringify(run.outputs, "[outputs]")}`);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Method used to log any errors of a chain run.
|
|
90
|
-
* @param run The chain run that has errored.
|
|
91
|
-
* @returns void
|
|
92
|
-
*/
|
|
93
|
-
onChainError(run) {
|
|
94
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
95
|
-
console.log(`${wrap(color.red, "[chain/error]")} [${crumbs}] [${elapsed(run)}] Chain run errored with error: ${tryJsonStringify(run.error, "[error]")}`);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Method used to log the start of an LLM run.
|
|
99
|
-
* @param run The LLM run that has started.
|
|
100
|
-
* @returns void
|
|
101
|
-
*/
|
|
102
|
-
onLLMStart(run) {
|
|
103
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
104
|
-
const inputs = "prompts" in run.inputs ? { prompts: run.inputs.prompts.map((p) => p.trim()) } : run.inputs;
|
|
105
|
-
console.log(`${wrap(color.green, "[llm/start]")} [${crumbs}] Entering LLM run with input: ${tryJsonStringify(inputs, "[inputs]")}`);
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Method used to log the end of an LLM run.
|
|
109
|
-
* @param run The LLM run that has ended.
|
|
110
|
-
* @returns void
|
|
111
|
-
*/
|
|
112
|
-
onLLMEnd(run) {
|
|
113
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
114
|
-
console.log(`${wrap(color.cyan, "[llm/end]")} [${crumbs}] [${elapsed(run)}] Exiting LLM run with output: ${tryJsonStringify(run.outputs, "[response]")}`);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Method used to log any errors of an LLM run.
|
|
118
|
-
* @param run The LLM run that has errored.
|
|
119
|
-
* @returns void
|
|
120
|
-
*/
|
|
121
|
-
onLLMError(run) {
|
|
122
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
123
|
-
console.log(`${wrap(color.red, "[llm/error]")} [${crumbs}] [${elapsed(run)}] LLM run errored with error: ${tryJsonStringify(run.error, "[error]")}`);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Method used to log the start of a tool run.
|
|
127
|
-
* @param run The tool run that has started.
|
|
128
|
-
* @returns void
|
|
129
|
-
*/
|
|
130
|
-
onToolStart(run) {
|
|
131
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
132
|
-
console.log(`${wrap(color.green, "[tool/start]")} [${crumbs}] Entering Tool run with input: "${formatKVMapItem(run.inputs.input)}"`);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Method used to log the end of a tool run.
|
|
136
|
-
* @param run The tool run that has ended.
|
|
137
|
-
* @returns void
|
|
138
|
-
*/
|
|
139
|
-
onToolEnd(run) {
|
|
140
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
141
|
-
console.log(`${wrap(color.cyan, "[tool/end]")} [${crumbs}] [${elapsed(run)}] Exiting Tool run with output: "${formatKVMapItem(run.outputs?.output)}"`);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Method used to log any errors of a tool run.
|
|
145
|
-
* @param run The tool run that has errored.
|
|
146
|
-
* @returns void
|
|
147
|
-
*/
|
|
148
|
-
onToolError(run) {
|
|
149
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
150
|
-
console.log(`${wrap(color.red, "[tool/error]")} [${crumbs}] [${elapsed(run)}] Tool run errored with error: ${tryJsonStringify(run.error, "[error]")}`);
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Method used to log the start of a retriever run.
|
|
154
|
-
* @param run The retriever run that has started.
|
|
155
|
-
* @returns void
|
|
156
|
-
*/
|
|
157
|
-
onRetrieverStart(run) {
|
|
158
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
159
|
-
console.log(`${wrap(color.green, "[retriever/start]")} [${crumbs}] Entering Retriever run with input: ${tryJsonStringify(run.inputs, "[inputs]")}`);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Method used to log the end of a retriever run.
|
|
163
|
-
* @param run The retriever run that has ended.
|
|
164
|
-
* @returns void
|
|
165
|
-
*/
|
|
166
|
-
onRetrieverEnd(run) {
|
|
167
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
168
|
-
console.log(`${wrap(color.cyan, "[retriever/end]")} [${crumbs}] [${elapsed(run)}] Exiting Retriever run with output: ${tryJsonStringify(run.outputs, "[outputs]")}`);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Method used to log any errors of a retriever run.
|
|
172
|
-
* @param run The retriever run that has errored.
|
|
173
|
-
* @returns void
|
|
174
|
-
*/
|
|
175
|
-
onRetrieverError(run) {
|
|
176
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
177
|
-
console.log(`${wrap(color.red, "[retriever/error]")} [${crumbs}] [${elapsed(run)}] Retriever run errored with error: ${tryJsonStringify(run.error, "[error]")}`);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Method used to log the action selected by the agent.
|
|
181
|
-
* @param run The run in which the agent action occurred.
|
|
182
|
-
* @returns void
|
|
183
|
-
*/
|
|
184
|
-
onAgentAction(run) {
|
|
185
|
-
const agentRun = run;
|
|
186
|
-
const crumbs = this.getBreadcrumbs(run);
|
|
187
|
-
console.log(`${wrap(color.blue, "[agent/action]")} [${crumbs}] Agent selected action: ${tryJsonStringify(agentRun.actions[agentRun.actions.length - 1], "[action]")}`);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
1
|
+
var gruvboxLight = {};
|
|
190
2
|
export {
|
|
191
|
-
|
|
192
|
-
console_exports
|
|
3
|
+
gruvboxLight as __exports
|
|
193
4
|
};
|
|
194
5
|
//# sourceMappingURL=index.es233.js.map
|
package/dist/index.es233.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es233.js","sources":["../node_modules/.pnpm/@langchain+core@1.1.13_openai@6.16.0_zod@4.3.5_/node_modules/@langchain/core/dist/tracers/console.js"],"sourcesContent":["import { __export } from \"../_virtual/rolldown_runtime.js\";\nimport { BaseTracer } from \"./base.js\";\nimport styles from \"ansi-styles\";\n\n//#region src/tracers/console.ts\nvar console_exports = {};\n__export(console_exports, { ConsoleCallbackHandler: () => ConsoleCallbackHandler });\nfunction wrap(style, text) {\n\treturn `${style.open}${text}${style.close}`;\n}\nfunction tryJsonStringify(obj, fallback) {\n\ttry {\n\t\treturn JSON.stringify(obj, null, 2);\n\t} catch {\n\t\treturn fallback;\n\t}\n}\nfunction formatKVMapItem(value) {\n\tif (typeof value === \"string\") return value.trim();\n\tif (value === null || value === void 0) return value;\n\treturn tryJsonStringify(value, value.toString());\n}\nfunction elapsed(run) {\n\tif (!run.end_time) return \"\";\n\tconst elapsed$1 = run.end_time - run.start_time;\n\tif (elapsed$1 < 1e3) return `${elapsed$1}ms`;\n\treturn `${(elapsed$1 / 1e3).toFixed(2)}s`;\n}\nconst { color } = styles;\n/**\n* A tracer that logs all events to the console. It extends from the\n* `BaseTracer` class and overrides its methods to provide custom logging\n* functionality.\n* @example\n* ```typescript\n*\n* const llm = new ChatAnthropic({\n* temperature: 0,\n* tags: [\"example\", \"callbacks\", \"constructor\"],\n* callbacks: [new ConsoleCallbackHandler()],\n* });\n*\n* ```\n*/\nvar ConsoleCallbackHandler = class extends BaseTracer {\n\tname = \"console_callback_handler\";\n\t/**\n\t* Method used to persist the run. In this case, it simply returns a\n\t* resolved promise as there's no persistence logic.\n\t* @param _run The run to persist.\n\t* @returns A resolved promise.\n\t*/\n\tpersistRun(_run) {\n\t\treturn Promise.resolve();\n\t}\n\t/**\n\t* Method used to get all the parent runs of a given run.\n\t* @param run The run whose parents are to be retrieved.\n\t* @returns An array of parent runs.\n\t*/\n\tgetParents(run) {\n\t\tconst parents = [];\n\t\tlet currentRun = run;\n\t\twhile (currentRun.parent_run_id) {\n\t\t\tconst parent = this.runMap.get(currentRun.parent_run_id);\n\t\t\tif (parent) {\n\t\t\t\tparents.push(parent);\n\t\t\t\tcurrentRun = parent;\n\t\t\t} else break;\n\t\t}\n\t\treturn parents;\n\t}\n\t/**\n\t* Method used to get a string representation of the run's lineage, which\n\t* is used in logging.\n\t* @param run The run whose lineage is to be retrieved.\n\t* @returns A string representation of the run's lineage.\n\t*/\n\tgetBreadcrumbs(run) {\n\t\tconst parents = this.getParents(run).reverse();\n\t\tconst string = [...parents, run].map((parent, i, arr) => {\n\t\t\tconst name = `${parent.execution_order}:${parent.run_type}:${parent.name}`;\n\t\t\treturn i === arr.length - 1 ? wrap(styles.bold, name) : name;\n\t\t}).join(\" > \");\n\t\treturn wrap(color.grey, string);\n\t}\n\t/**\n\t* Method used to log the start of a chain run.\n\t* @param run The chain run that has started.\n\t* @returns void\n\t*/\n\tonChainStart(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.green, \"[chain/start]\")} [${crumbs}] Entering Chain run with input: ${tryJsonStringify(run.inputs, \"[inputs]\")}`);\n\t}\n\t/**\n\t* Method used to log the end of a chain run.\n\t* @param run The chain run that has ended.\n\t* @returns void\n\t*/\n\tonChainEnd(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.cyan, \"[chain/end]\")} [${crumbs}] [${elapsed(run)}] Exiting Chain run with output: ${tryJsonStringify(run.outputs, \"[outputs]\")}`);\n\t}\n\t/**\n\t* Method used to log any errors of a chain run.\n\t* @param run The chain run that has errored.\n\t* @returns void\n\t*/\n\tonChainError(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.red, \"[chain/error]\")} [${crumbs}] [${elapsed(run)}] Chain run errored with error: ${tryJsonStringify(run.error, \"[error]\")}`);\n\t}\n\t/**\n\t* Method used to log the start of an LLM run.\n\t* @param run The LLM run that has started.\n\t* @returns void\n\t*/\n\tonLLMStart(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconst inputs = \"prompts\" in run.inputs ? { prompts: run.inputs.prompts.map((p) => p.trim()) } : run.inputs;\n\t\tconsole.log(`${wrap(color.green, \"[llm/start]\")} [${crumbs}] Entering LLM run with input: ${tryJsonStringify(inputs, \"[inputs]\")}`);\n\t}\n\t/**\n\t* Method used to log the end of an LLM run.\n\t* @param run The LLM run that has ended.\n\t* @returns void\n\t*/\n\tonLLMEnd(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.cyan, \"[llm/end]\")} [${crumbs}] [${elapsed(run)}] Exiting LLM run with output: ${tryJsonStringify(run.outputs, \"[response]\")}`);\n\t}\n\t/**\n\t* Method used to log any errors of an LLM run.\n\t* @param run The LLM run that has errored.\n\t* @returns void\n\t*/\n\tonLLMError(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.red, \"[llm/error]\")} [${crumbs}] [${elapsed(run)}] LLM run errored with error: ${tryJsonStringify(run.error, \"[error]\")}`);\n\t}\n\t/**\n\t* Method used to log the start of a tool run.\n\t* @param run The tool run that has started.\n\t* @returns void\n\t*/\n\tonToolStart(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.green, \"[tool/start]\")} [${crumbs}] Entering Tool run with input: \"${formatKVMapItem(run.inputs.input)}\"`);\n\t}\n\t/**\n\t* Method used to log the end of a tool run.\n\t* @param run The tool run that has ended.\n\t* @returns void\n\t*/\n\tonToolEnd(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.cyan, \"[tool/end]\")} [${crumbs}] [${elapsed(run)}] Exiting Tool run with output: \"${formatKVMapItem(run.outputs?.output)}\"`);\n\t}\n\t/**\n\t* Method used to log any errors of a tool run.\n\t* @param run The tool run that has errored.\n\t* @returns void\n\t*/\n\tonToolError(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.red, \"[tool/error]\")} [${crumbs}] [${elapsed(run)}] Tool run errored with error: ${tryJsonStringify(run.error, \"[error]\")}`);\n\t}\n\t/**\n\t* Method used to log the start of a retriever run.\n\t* @param run The retriever run that has started.\n\t* @returns void\n\t*/\n\tonRetrieverStart(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.green, \"[retriever/start]\")} [${crumbs}] Entering Retriever run with input: ${tryJsonStringify(run.inputs, \"[inputs]\")}`);\n\t}\n\t/**\n\t* Method used to log the end of a retriever run.\n\t* @param run The retriever run that has ended.\n\t* @returns void\n\t*/\n\tonRetrieverEnd(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.cyan, \"[retriever/end]\")} [${crumbs}] [${elapsed(run)}] Exiting Retriever run with output: ${tryJsonStringify(run.outputs, \"[outputs]\")}`);\n\t}\n\t/**\n\t* Method used to log any errors of a retriever run.\n\t* @param run The retriever run that has errored.\n\t* @returns void\n\t*/\n\tonRetrieverError(run) {\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.red, \"[retriever/error]\")} [${crumbs}] [${elapsed(run)}] Retriever run errored with error: ${tryJsonStringify(run.error, \"[error]\")}`);\n\t}\n\t/**\n\t* Method used to log the action selected by the agent.\n\t* @param run The run in which the agent action occurred.\n\t* @returns void\n\t*/\n\tonAgentAction(run) {\n\t\tconst agentRun = run;\n\t\tconst crumbs = this.getBreadcrumbs(run);\n\t\tconsole.log(`${wrap(color.blue, \"[agent/action]\")} [${crumbs}] Agent selected action: ${tryJsonStringify(agentRun.actions[agentRun.actions.length - 1], \"[action]\")}`);\n\t}\n};\n\n//#endregion\nexport { ConsoleCallbackHandler, console_exports };\n//# sourceMappingURL=console.js.map"],"names":[],"mappings":";;;AAKG,IAAC,kBAAkB,CAAA;AACtB,SAAS,iBAAiB,EAAE,wBAAwB,MAAM,uBAAsB,CAAE;AAClF,SAAS,KAAK,OAAO,MAAM;AAC1B,SAAO,GAAG,MAAM,IAAI,GAAG,IAAI,GAAG,MAAM,KAAK;AAC1C;AACA,SAAS,iBAAiB,KAAK,UAAU;AACxC,MAAI;AACH,WAAO,KAAK,UAAU,KAAK,MAAM,CAAC;AAAA,EACnC,QAAQ;AACP,WAAO;AAAA,EACR;AACD;AACA,SAAS,gBAAgB,OAAO;AAC/B,MAAI,OAAO,UAAU,SAAU,QAAO,MAAM,KAAI;AAChD,MAAI,UAAU,QAAQ,UAAU,OAAQ,QAAO;AAC/C,SAAO,iBAAiB,OAAO,MAAM,SAAQ,CAAE;AAChD;AACA,SAAS,QAAQ,KAAK;AACrB,MAAI,CAAC,IAAI,SAAU,QAAO;AAC1B,QAAM,YAAY,IAAI,WAAW,IAAI;AACrC,MAAI,YAAY,IAAK,QAAO,GAAG,SAAS;AACxC,SAAO,IAAI,YAAY,KAAK,QAAQ,CAAC,CAAC;AACvC;AACA,MAAM,EAAE,MAAK,IAAK;AAgBf,IAAC,yBAAyB,cAAc,WAAW;AAAA,EACrD,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOP,WAAW,MAAM;AAChB,WAAO,QAAQ,QAAO;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAW,KAAK;AACf,UAAM,UAAU,CAAA;AAChB,QAAI,aAAa;AACjB,WAAO,WAAW,eAAe;AAChC,YAAM,SAAS,KAAK,OAAO,IAAI,WAAW,aAAa;AACvD,UAAI,QAAQ;AACX,gBAAQ,KAAK,MAAM;AACnB,qBAAa;AAAA,MACd,MAAO;AAAA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.es233.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es234.js
CHANGED
|
@@ -1,113 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { mergeUsageMetadata } from "./index.es55.js";
|
|
3
|
-
import { AIMessage } from "./index.es41.js";
|
|
4
|
-
import { BaseTracer } from "./index.es123.js";
|
|
5
|
-
import { getDefaultLangChainClientSingleton } from "./index.es262.js";
|
|
6
|
-
import { getCurrentRunTree } from "./index.es107.js";
|
|
7
|
-
import { RunTree } from "./index.es120.js";
|
|
8
|
-
import "uuid";
|
|
9
|
-
import "./index.es117.js";
|
|
10
|
-
import "./index.es118.js";
|
|
11
|
-
import "./index.es119.js";
|
|
12
|
-
import { getDefaultProjectName } from "./index.es263.js";
|
|
13
|
-
var tracer_langchain_exports = {};
|
|
14
|
-
__export(tracer_langchain_exports, { LangChainTracer: () => LangChainTracer });
|
|
15
|
-
function _getUsageMetadataFromGenerations(generations) {
|
|
16
|
-
let output = void 0;
|
|
17
|
-
for (const generationBatch of generations) for (const generation of generationBatch) if (AIMessage.isInstance(generation.message) && generation.message.usage_metadata !== void 0) output = mergeUsageMetadata(output, generation.message.usage_metadata);
|
|
18
|
-
return output;
|
|
19
|
-
}
|
|
20
|
-
var LangChainTracer = class LangChainTracer2 extends BaseTracer {
|
|
21
|
-
name = "langchain_tracer";
|
|
22
|
-
projectName;
|
|
23
|
-
exampleId;
|
|
24
|
-
client;
|
|
25
|
-
replicas;
|
|
26
|
-
usesRunTreeMap = true;
|
|
27
|
-
constructor(fields = {}) {
|
|
28
|
-
super(fields);
|
|
29
|
-
const { exampleId, projectName, client, replicas } = fields;
|
|
30
|
-
this.projectName = projectName ?? getDefaultProjectName();
|
|
31
|
-
this.replicas = replicas;
|
|
32
|
-
this.exampleId = exampleId;
|
|
33
|
-
this.client = client ?? getDefaultLangChainClientSingleton();
|
|
34
|
-
const traceableTree = LangChainTracer2.getTraceableRunTree();
|
|
35
|
-
if (traceableTree) this.updateFromRunTree(traceableTree);
|
|
36
|
-
}
|
|
37
|
-
async persistRun(_run) {
|
|
38
|
-
}
|
|
39
|
-
async onRunCreate(run) {
|
|
40
|
-
if (!run.extra?.lc_defers_inputs) {
|
|
41
|
-
const runTree = this.getRunTreeWithTracingConfig(run.id);
|
|
42
|
-
await runTree?.postRun();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
async onRunUpdate(run) {
|
|
46
|
-
const runTree = this.getRunTreeWithTracingConfig(run.id);
|
|
47
|
-
if (run.extra?.lc_defers_inputs) await runTree?.postRun();
|
|
48
|
-
else await runTree?.patchRun();
|
|
49
|
-
}
|
|
50
|
-
onLLMEnd(run) {
|
|
51
|
-
const outputs = run.outputs;
|
|
52
|
-
if (outputs?.generations) {
|
|
53
|
-
const usageMetadata = _getUsageMetadataFromGenerations(outputs.generations);
|
|
54
|
-
if (usageMetadata !== void 0) {
|
|
55
|
-
run.extra = run.extra ?? {};
|
|
56
|
-
const metadata = run.extra.metadata ?? {};
|
|
57
|
-
metadata.usage_metadata = usageMetadata;
|
|
58
|
-
run.extra.metadata = metadata;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
getRun(id) {
|
|
63
|
-
return this.runTreeMap.get(id);
|
|
64
|
-
}
|
|
65
|
-
updateFromRunTree(runTree) {
|
|
66
|
-
this.runTreeMap.set(runTree.id, runTree);
|
|
67
|
-
let rootRun = runTree;
|
|
68
|
-
const visited = /* @__PURE__ */ new Set();
|
|
69
|
-
while (rootRun.parent_run) {
|
|
70
|
-
if (visited.has(rootRun.id)) break;
|
|
71
|
-
visited.add(rootRun.id);
|
|
72
|
-
if (!rootRun.parent_run) break;
|
|
73
|
-
rootRun = rootRun.parent_run;
|
|
74
|
-
}
|
|
75
|
-
visited.clear();
|
|
76
|
-
const queue = [rootRun];
|
|
77
|
-
while (queue.length > 0) {
|
|
78
|
-
const current = queue.shift();
|
|
79
|
-
if (!current || visited.has(current.id)) continue;
|
|
80
|
-
visited.add(current.id);
|
|
81
|
-
this.runTreeMap.set(current.id, current);
|
|
82
|
-
if (current.child_runs) queue.push(...current.child_runs);
|
|
83
|
-
}
|
|
84
|
-
this.client = runTree.client ?? this.client;
|
|
85
|
-
this.replicas = runTree.replicas ?? this.replicas;
|
|
86
|
-
this.projectName = runTree.project_name ?? this.projectName;
|
|
87
|
-
this.exampleId = runTree.reference_example_id ?? this.exampleId;
|
|
88
|
-
}
|
|
89
|
-
getRunTreeWithTracingConfig(id) {
|
|
90
|
-
const runTree = this.runTreeMap.get(id);
|
|
91
|
-
if (!runTree) return void 0;
|
|
92
|
-
return new RunTree({
|
|
93
|
-
...runTree,
|
|
94
|
-
client: this.client,
|
|
95
|
-
project_name: this.projectName,
|
|
96
|
-
replicas: this.replicas,
|
|
97
|
-
reference_example_id: this.exampleId,
|
|
98
|
-
tracingEnabled: true
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
static getTraceableRunTree() {
|
|
102
|
-
try {
|
|
103
|
-
return getCurrentRunTree(true);
|
|
104
|
-
} catch {
|
|
105
|
-
return void 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
};
|
|
1
|
+
var holiTheme = {};
|
|
109
2
|
export {
|
|
110
|
-
|
|
111
|
-
tracer_langchain_exports
|
|
3
|
+
holiTheme as __exports
|
|
112
4
|
};
|
|
113
5
|
//# sourceMappingURL=index.es234.js.map
|
package/dist/index.es234.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es234.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es234.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es235.js
CHANGED
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { getGlobalAsyncLocalStorageInstance } from "./index.es115.js";
|
|
3
|
-
import PQueueMod from "./index.es117.js";
|
|
4
|
-
let queue;
|
|
5
|
-
function createQueue() {
|
|
6
|
-
const PQueue = "default" in PQueueMod ? PQueueMod.default : PQueueMod;
|
|
7
|
-
return new PQueue({
|
|
8
|
-
autoStart: true,
|
|
9
|
-
concurrency: 1
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
function getQueue() {
|
|
13
|
-
if (typeof queue === "undefined") queue = createQueue();
|
|
14
|
-
return queue;
|
|
15
|
-
}
|
|
16
|
-
async function consumeCallback(promiseFn, wait) {
|
|
17
|
-
if (wait === true) {
|
|
18
|
-
const asyncLocalStorageInstance = getGlobalAsyncLocalStorageInstance();
|
|
19
|
-
if (asyncLocalStorageInstance !== void 0) await asyncLocalStorageInstance.run(void 0, async () => promiseFn());
|
|
20
|
-
else await promiseFn();
|
|
21
|
-
} else {
|
|
22
|
-
queue = getQueue();
|
|
23
|
-
queue.add(async () => {
|
|
24
|
-
const asyncLocalStorageInstance = getGlobalAsyncLocalStorageInstance();
|
|
25
|
-
if (asyncLocalStorageInstance !== void 0) await asyncLocalStorageInstance.run(void 0, async () => promiseFn());
|
|
26
|
-
else await promiseFn();
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async function awaitAllCallbacks() {
|
|
31
|
-
const defaultClient = getDefaultLangChainClientSingleton();
|
|
32
|
-
await Promise.allSettled([typeof queue !== "undefined" ? queue.onIdle() : Promise.resolve(), defaultClient.awaitPendingTraceBatches()]);
|
|
33
|
-
}
|
|
1
|
+
var hopscotch = {};
|
|
34
2
|
export {
|
|
35
|
-
|
|
36
|
-
consumeCallback
|
|
3
|
+
hopscotch as __exports
|
|
37
4
|
};
|
|
38
5
|
//# sourceMappingURL=index.es235.js.map
|
package/dist/index.es235.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es235.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es235.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es236.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { consumeCallback, awaitAllCallbacks } from "./index.es235.js";
|
|
3
|
-
var promises_exports = {};
|
|
4
|
-
__export(promises_exports, {
|
|
5
|
-
awaitAllCallbacks: () => awaitAllCallbacks,
|
|
6
|
-
consumeCallback: () => consumeCallback
|
|
7
|
-
});
|
|
1
|
+
var lucario = {};
|
|
8
2
|
export {
|
|
9
|
-
|
|
10
|
-
consumeCallback,
|
|
11
|
-
promises_exports
|
|
3
|
+
lucario as __exports
|
|
12
4
|
};
|
|
13
5
|
//# sourceMappingURL=index.es236.js.map
|
package/dist/index.es236.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es236.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es236.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es237.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const isTracingEnabled = (tracingEnabled) => {
|
|
3
|
-
const envVars = [
|
|
4
|
-
"LANGSMITH_TRACING_V2",
|
|
5
|
-
"LANGCHAIN_TRACING_V2",
|
|
6
|
-
"LANGSMITH_TRACING",
|
|
7
|
-
"LANGCHAIN_TRACING"
|
|
8
|
-
];
|
|
9
|
-
return !!envVars.find((envVar) => getEnvironmentVariable(envVar) === "true");
|
|
10
|
-
};
|
|
1
|
+
var materialDark = {};
|
|
11
2
|
export {
|
|
12
|
-
|
|
3
|
+
materialDark as __exports
|
|
13
4
|
};
|
|
14
5
|
//# sourceMappingURL=index.es237.js.map
|
package/dist/index.es237.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es237.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es237.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es238.js
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import "./index.es120.js";
|
|
3
|
-
function getContextVariable(name) {
|
|
4
|
-
const asyncLocalStorageInstance = getGlobalAsyncLocalStorageInstance();
|
|
5
|
-
if (asyncLocalStorageInstance === void 0) return void 0;
|
|
6
|
-
const runTree = asyncLocalStorageInstance.getStore();
|
|
7
|
-
return runTree?.[_CONTEXT_VARIABLES_KEY]?.[name];
|
|
8
|
-
}
|
|
9
|
-
const LC_CONFIGURE_HOOKS_KEY = /* @__PURE__ */ Symbol("lc:configure_hooks");
|
|
10
|
-
const _getConfigureHooks = () => getContextVariable(LC_CONFIGURE_HOOKS_KEY) || [];
|
|
1
|
+
var materialLight = {};
|
|
11
2
|
export {
|
|
12
|
-
|
|
13
|
-
getContextVariable
|
|
3
|
+
materialLight as __exports
|
|
14
4
|
};
|
|
15
5
|
//# sourceMappingURL=index.es238.js.map
|
package/dist/index.es238.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es238.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es238.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es239.js
CHANGED
|
@@ -1,94 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
function hasOwnProperty(obj, key) {
|
|
3
|
-
return _hasOwnProperty.call(obj, key);
|
|
4
|
-
}
|
|
5
|
-
function _objectKeys(obj) {
|
|
6
|
-
if (Array.isArray(obj)) {
|
|
7
|
-
const keys$1 = new Array(obj.length);
|
|
8
|
-
for (let k = 0; k < keys$1.length; k++) keys$1[k] = "" + k;
|
|
9
|
-
return keys$1;
|
|
10
|
-
}
|
|
11
|
-
if (Object.keys) return Object.keys(obj);
|
|
12
|
-
let keys = [];
|
|
13
|
-
for (let i in obj) if (hasOwnProperty(obj, i)) keys.push(i);
|
|
14
|
-
return keys;
|
|
15
|
-
}
|
|
16
|
-
function _deepClone(obj) {
|
|
17
|
-
switch (typeof obj) {
|
|
18
|
-
case "object":
|
|
19
|
-
return JSON.parse(JSON.stringify(obj));
|
|
20
|
-
case "undefined":
|
|
21
|
-
return null;
|
|
22
|
-
default:
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function isInteger(str) {
|
|
27
|
-
let i = 0;
|
|
28
|
-
const len = str.length;
|
|
29
|
-
let charCode;
|
|
30
|
-
while (i < len) {
|
|
31
|
-
charCode = str.charCodeAt(i);
|
|
32
|
-
if (charCode >= 48 && charCode <= 57) {
|
|
33
|
-
i++;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
function unescapePathComponent(path) {
|
|
41
|
-
return path.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
42
|
-
}
|
|
43
|
-
function hasUndefined(obj) {
|
|
44
|
-
if (obj === void 0) return true;
|
|
45
|
-
if (obj) {
|
|
46
|
-
if (Array.isArray(obj)) {
|
|
47
|
-
for (let i$1 = 0, len = obj.length; i$1 < len; i$1++) if (hasUndefined(obj[i$1])) return true;
|
|
48
|
-
} else if (typeof obj === "object") {
|
|
49
|
-
const objKeys = _objectKeys(obj);
|
|
50
|
-
const objKeysLength = objKeys.length;
|
|
51
|
-
for (var i = 0; i < objKeysLength; i++) if (hasUndefined(obj[objKeys[i]])) return true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
function patchErrorMessageFormatter(message, args) {
|
|
57
|
-
const messageParts = [message];
|
|
58
|
-
for (const key in args) {
|
|
59
|
-
const value = typeof args[key] === "object" ? JSON.stringify(args[key], null, 2) : args[key];
|
|
60
|
-
if (typeof value !== "undefined") messageParts.push(`${key}: ${value}`);
|
|
61
|
-
}
|
|
62
|
-
return messageParts.join("\n");
|
|
63
|
-
}
|
|
64
|
-
var PatchError = class extends Error {
|
|
65
|
-
constructor(message, name, index, operation, tree) {
|
|
66
|
-
super(patchErrorMessageFormatter(message, {
|
|
67
|
-
name,
|
|
68
|
-
index,
|
|
69
|
-
operation,
|
|
70
|
-
tree
|
|
71
|
-
}));
|
|
72
|
-
this.name = name;
|
|
73
|
-
this.index = index;
|
|
74
|
-
this.operation = operation;
|
|
75
|
-
this.tree = tree;
|
|
76
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
77
|
-
this.message = patchErrorMessageFormatter(message, {
|
|
78
|
-
name,
|
|
79
|
-
index,
|
|
80
|
-
operation,
|
|
81
|
-
tree
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
};
|
|
1
|
+
var materialOceanic = {};
|
|
85
2
|
export {
|
|
86
|
-
|
|
87
|
-
_deepClone,
|
|
88
|
-
_objectKeys,
|
|
89
|
-
hasOwnProperty,
|
|
90
|
-
hasUndefined,
|
|
91
|
-
isInteger,
|
|
92
|
-
unescapePathComponent
|
|
3
|
+
materialOceanic as __exports
|
|
93
4
|
};
|
|
94
5
|
//# sourceMappingURL=index.es239.js.map
|
package/dist/index.es239.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es239.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.es239.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index.es24.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { getContentString } from "./index.es23.js";
|
|
3
3
|
import { BotMessageSquare, Loader2 } from "lucide-react";
|
|
4
4
|
import React__default from "react";
|
|
5
|
-
import { AgentMarkdown } from "./index.
|
|
5
|
+
import { AgentMarkdown } from "./index.es51.js";
|
|
6
6
|
function AgentMessage({
|
|
7
7
|
message,
|
|
8
8
|
isStreaming = false
|