@langgraph-js/sdk 1.10.3 → 1.10.4
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/TestKit.d.ts
CHANGED
package/dist/TestKit.js
CHANGED
|
@@ -8,10 +8,10 @@ export class TestLogger {
|
|
|
8
8
|
const emoji = message.type === "ai" ? "🤖" : message.type === "human" ? "👤" : "🔧";
|
|
9
9
|
const header = `${emoji} ${message.type} | ${(_a = message.name) !== null && _a !== void 0 ? _a : "null"} | ${message.id}`;
|
|
10
10
|
if (message.type === "tool") {
|
|
11
|
-
return `${header}
|
|
11
|
+
return console.log(`${header}
|
|
12
12
|
🔧 Input: ${(_c = (_b = message.tool_input) === null || _b === void 0 ? void 0 : _b.slice(0, 100)) !== null && _c !== void 0 ? _c : ""}
|
|
13
13
|
💬 Output: ${(_e = (_d = message.content) === null || _d === void 0 ? void 0 : _d.slice(0, 100)) !== null && _e !== void 0 ? _e : ""}
|
|
14
|
-
|
|
14
|
+
`);
|
|
15
15
|
}
|
|
16
16
|
console.log(`---
|
|
17
17
|
${header}
|
|
@@ -83,7 +83,7 @@ export class TestLangGraphChat {
|
|
|
83
83
|
this.checkAllTask(this.getMessages(), {
|
|
84
84
|
skipLengthCheck: true,
|
|
85
85
|
});
|
|
86
|
-
},
|
|
86
|
+
}, 10);
|
|
87
87
|
return oldExecute(...args);
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -166,7 +166,7 @@ export class TestLangGraphChat {
|
|
|
166
166
|
])
|
|
167
167
|
.then(async () => {
|
|
168
168
|
// messages 有 10 ms 的 debounce,我们需要稍等一下
|
|
169
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
169
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
170
170
|
this.checkAllTask(this.getMessages(), {
|
|
171
171
|
skipLengthCheck: true,
|
|
172
172
|
});
|
|
@@ -110,6 +110,8 @@ export const createChatStore = (initClientName, config, context = {}) => {
|
|
|
110
110
|
// await newClient.createThread();
|
|
111
111
|
inChatError.set(null);
|
|
112
112
|
newClient.onStreamingUpdate((event) => {
|
|
113
|
+
var _a;
|
|
114
|
+
currentChatId.set(((_a = newClient.getCurrentThread()) === null || _a === void 0 ? void 0 : _a.thread_id) || null);
|
|
113
115
|
if (event.type === "start")
|
|
114
116
|
loading.set(true);
|
|
115
117
|
if (event.type === "thread" || event.type === "done") {
|
package/package.json
CHANGED
package/src/TestKit.ts
CHANGED
|
@@ -25,10 +25,10 @@ export class TestLogger {
|
|
|
25
25
|
|
|
26
26
|
const header = `${emoji} ${message.type} | ${message.name ?? "null"} | ${message.id}`;
|
|
27
27
|
if (message.type === "tool") {
|
|
28
|
-
return `${header}
|
|
28
|
+
return console.log(`${header}
|
|
29
29
|
🔧 Input: ${message.tool_input?.slice(0, 100) ?? ""}
|
|
30
30
|
💬 Output: ${message.content?.slice(0, 100) ?? ""}
|
|
31
|
-
|
|
31
|
+
`);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
console.log(`---
|
|
@@ -110,7 +110,7 @@ export class TestLangGraphChat {
|
|
|
110
110
|
this.checkAllTask(this.getMessages(), {
|
|
111
111
|
skipLengthCheck: true,
|
|
112
112
|
});
|
|
113
|
-
},
|
|
113
|
+
}, 10);
|
|
114
114
|
return oldExecute!(...args);
|
|
115
115
|
};
|
|
116
116
|
}
|
|
@@ -199,7 +199,7 @@ export class TestLangGraphChat {
|
|
|
199
199
|
])
|
|
200
200
|
.then(async () => {
|
|
201
201
|
// messages 有 10 ms 的 debounce,我们需要稍等一下
|
|
202
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
202
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
203
203
|
this.checkAllTask(this.getMessages(), {
|
|
204
204
|
skipLengthCheck: true,
|
|
205
205
|
});
|
|
@@ -117,6 +117,7 @@ export const createChatStore = (
|
|
|
117
117
|
// await newClient.createThread();
|
|
118
118
|
inChatError.set(null);
|
|
119
119
|
newClient.onStreamingUpdate((event) => {
|
|
120
|
+
currentChatId.set(newClient.getCurrentThread()?.thread_id || null);
|
|
120
121
|
if (event.type === "start") loading.set(true);
|
|
121
122
|
if (event.type === "thread" || event.type === "done") {
|
|
122
123
|
// console.log(event.data);
|