@assistant-ui/react-langgraph 0.7.11 → 0.7.13
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/LangGraphMessageAccumulator.js +32 -38
- package/dist/LangGraphMessageAccumulator.js.map +1 -1
- package/dist/appendLangChainChunk.d.ts +1 -1
- package/dist/appendLangChainChunk.d.ts.map +1 -1
- package/dist/appendLangChainChunk.js +55 -50
- package/dist/appendLangChainChunk.js.map +1 -1
- package/dist/convertLangChainMessages.d.ts +1 -1
- package/dist/convertLangChainMessages.d.ts.map +1 -1
- package/dist/convertLangChainMessages.js +117 -113
- package/dist/convertLangChainMessages.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -23
- package/dist/index.js.map +1 -1
- package/dist/testUtils.d.ts +2 -2
- package/dist/testUtils.d.ts.map +1 -1
- package/dist/testUtils.js +4 -8
- package/dist/testUtils.js.map +1 -1
- package/dist/types.js +10 -14
- package/dist/types.js.map +1 -1
- package/dist/useLangGraphMessages.d.ts +1 -1
- package/dist/useLangGraphMessages.d.ts.map +1 -1
- package/dist/useLangGraphMessages.js +115 -131
- package/dist/useLangGraphMessages.js.map +1 -1
- package/dist/useLangGraphRuntime.d.ts +2 -2
- package/dist/useLangGraphRuntime.d.ts.map +1 -1
- package/dist/useLangGraphRuntime.js +191 -236
- package/dist/useLangGraphRuntime.js.map +1 -1
- package/package.json +26 -15
|
@@ -1,42 +1,36 @@
|
|
|
1
|
-
// src/LangGraphMessageAccumulator.ts
|
|
2
1
|
import { v4 as uuidv4 } from "uuid";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = {}) {
|
|
10
|
-
this.appendMessage = appendMessage;
|
|
11
|
-
this.addMessages(initialMessages);
|
|
12
|
-
}
|
|
13
|
-
ensureMessageId(message) {
|
|
14
|
-
return message.id ? message : { ...message, id: uuidv4() };
|
|
15
|
-
}
|
|
16
|
-
addMessages(newMessages) {
|
|
17
|
-
if (newMessages.length === 0) return this.getMessages();
|
|
18
|
-
for (const message of newMessages.map(this.ensureMessageId)) {
|
|
19
|
-
const messageId = message.id;
|
|
20
|
-
const previous = this.messagesMap.get(messageId);
|
|
21
|
-
this.messagesMap.set(messageId, this.appendMessage(previous, message));
|
|
2
|
+
export class LangGraphMessageAccumulator {
|
|
3
|
+
messagesMap = new Map();
|
|
4
|
+
appendMessage;
|
|
5
|
+
constructor({ initialMessages = [], appendMessage = ((_, curr) => curr), } = {}) {
|
|
6
|
+
this.appendMessage = appendMessage;
|
|
7
|
+
this.addMessages(initialMessages);
|
|
22
8
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getMessages() {
|
|
26
|
-
return [...this.messagesMap.values()];
|
|
27
|
-
}
|
|
28
|
-
replaceMessages(newMessages) {
|
|
29
|
-
this.messagesMap.clear();
|
|
30
|
-
for (const message of newMessages.map(this.ensureMessageId)) {
|
|
31
|
-
this.messagesMap.set(message.id, message);
|
|
9
|
+
ensureMessageId(message) {
|
|
10
|
+
return message.id ? message : { ...message, id: uuidv4() };
|
|
32
11
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
addMessages(newMessages) {
|
|
13
|
+
if (newMessages.length === 0)
|
|
14
|
+
return this.getMessages();
|
|
15
|
+
for (const message of newMessages.map(this.ensureMessageId)) {
|
|
16
|
+
const messageId = message.id; // ensureMessageId guarantees id exists
|
|
17
|
+
const previous = this.messagesMap.get(messageId);
|
|
18
|
+
this.messagesMap.set(messageId, this.appendMessage(previous, message));
|
|
19
|
+
}
|
|
20
|
+
return this.getMessages();
|
|
21
|
+
}
|
|
22
|
+
getMessages() {
|
|
23
|
+
return [...this.messagesMap.values()];
|
|
24
|
+
}
|
|
25
|
+
replaceMessages(newMessages) {
|
|
26
|
+
this.messagesMap.clear();
|
|
27
|
+
for (const message of newMessages.map(this.ensureMessageId)) {
|
|
28
|
+
this.messagesMap.set(message.id, message);
|
|
29
|
+
}
|
|
30
|
+
return this.getMessages();
|
|
31
|
+
}
|
|
32
|
+
clear() {
|
|
33
|
+
this.messagesMap.clear();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
42
36
|
//# sourceMappingURL=LangGraphMessageAccumulator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"LangGraphMessageAccumulator.js","sourceRoot":"","sources":["../src/LangGraphMessageAccumulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAOpC,MAAM,OAAO,2BAA2B;IAC9B,WAAW,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,aAAa,CAGP;IAEd,YAAY,EACV,eAAe,GAAG,EAAE,EACpB,aAAa,GAAG,CAAC,CAAC,CAAuB,EAAE,IAAc,EAAE,EAAE,CAAC,IAAI,CAGrD,MACgC,EAAE;QAC/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACpC,CAAC;IAEO,eAAe,CAAC,OAAiB;QACvC,OAAO,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IAC7D,CAAC;IAEM,WAAW,CAAC,WAAuB;QACxC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAExD,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,EAAG,CAAC,CAAC,uCAAuC;YACtE,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YACjD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAEM,WAAW;QAChB,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC;IACxC,CAAC;IAEM,eAAe,CAAC,WAAuB;QAC5C,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QAEzB,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAG,EAAE,OAAO,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;IAC5B,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LangChainMessage, LangChainMessageChunk } from "./types";
|
|
1
|
+
import { LangChainMessage, LangChainMessageChunk } from "./types.js";
|
|
2
2
|
export declare const appendLangChainChunk: (prev: LangChainMessage | undefined, curr: LangChainMessage | LangChainMessageChunk) => LangChainMessage;
|
|
3
3
|
//# sourceMappingURL=appendLangChainChunk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appendLangChainChunk.d.ts","sourceRoot":"","sources":["../src/appendLangChainChunk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAEtB,
|
|
1
|
+
{"version":3,"file":"appendLangChainChunk.d.ts","sourceRoot":"","sources":["../src/appendLangChainChunk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAEtB,mBAAgB;AAGjB,eAAO,MAAM,oBAAoB,GAC/B,MAAM,gBAAgB,GAAG,SAAS,EAClC,MAAM,gBAAgB,GAAG,qBAAqB,KAC7C,gBAgEF,CAAC"}
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
// src/appendLangChainChunk.ts
|
|
2
1
|
import { parsePartialJsonObject } from "assistant-stream/utils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
const newContent = typeof prev.content === "string" ? [{ type: "text", text: prev.content }] : [...prev.content];
|
|
14
|
-
if (typeof curr?.content === "string") {
|
|
15
|
-
const lastIndex = newContent.length - 1;
|
|
16
|
-
if (newContent[lastIndex]?.type === "text") {
|
|
17
|
-
newContent[lastIndex].text = newContent[lastIndex].text + curr.content;
|
|
18
|
-
} else {
|
|
19
|
-
newContent.push({ type: "text", text: curr.content });
|
|
2
|
+
export const appendLangChainChunk = (prev, curr) => {
|
|
3
|
+
if (curr.type !== "AIMessageChunk") {
|
|
4
|
+
return curr;
|
|
5
|
+
}
|
|
6
|
+
if (!prev || prev.type !== "ai") {
|
|
7
|
+
return {
|
|
8
|
+
...curr,
|
|
9
|
+
type: curr.type.replace("MessageChunk", "").toLowerCase(),
|
|
10
|
+
};
|
|
20
11
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
if (item.type === "text") {
|
|
12
|
+
const newContent = typeof prev.content === "string"
|
|
13
|
+
? [{ type: "text", text: prev.content }]
|
|
14
|
+
: [...prev.content];
|
|
15
|
+
if (typeof curr?.content === "string") {
|
|
16
|
+
const lastIndex = newContent.length - 1;
|
|
28
17
|
if (newContent[lastIndex]?.type === "text") {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
newContent[lastIndex].text =
|
|
19
|
+
newContent[lastIndex].text + curr.content;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
newContent.push({ type: "text", text: curr.content });
|
|
32
23
|
}
|
|
33
|
-
} else if (item.type === "image_url") {
|
|
34
|
-
newContent.push(item);
|
|
35
|
-
}
|
|
36
24
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
else if (Array.isArray(curr.content)) {
|
|
26
|
+
const lastIndex = newContent.length - 1;
|
|
27
|
+
for (const item of curr.content) {
|
|
28
|
+
if (!("type" in item)) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (item.type === "text") {
|
|
32
|
+
if (newContent[lastIndex]?.type === "text") {
|
|
33
|
+
newContent[lastIndex].text =
|
|
34
|
+
newContent[lastIndex].text + item.text;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
newContent.push({ type: "text", text: item.text });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (item.type === "image_url") {
|
|
41
|
+
newContent.push(item);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const newToolCalls = [...(prev.tool_calls ?? [])];
|
|
46
|
+
for (const chunk of curr.tool_call_chunks ?? []) {
|
|
47
|
+
const existing = newToolCalls[chunk.index - 1] ?? { partial_json: "" };
|
|
48
|
+
const partialJson = existing.partial_json + chunk.args;
|
|
49
|
+
newToolCalls[chunk.index - 1] = {
|
|
50
|
+
...chunk,
|
|
51
|
+
...existing,
|
|
52
|
+
partial_json: partialJson,
|
|
53
|
+
args: parsePartialJsonObject(partialJson) ??
|
|
54
|
+
("args" in existing ? existing.args : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
...prev,
|
|
59
|
+
content: newContent,
|
|
60
|
+
tool_calls: newToolCalls,
|
|
47
61
|
};
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
...prev,
|
|
51
|
-
content: newContent,
|
|
52
|
-
tool_calls: newToolCalls
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
appendLangChainChunk
|
|
57
62
|
};
|
|
58
63
|
//# sourceMappingURL=appendLangChainChunk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"appendLangChainChunk.js","sourceRoot":"","sources":["../src/appendLangChainChunk.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAkC,EAClC,IAA8C,EAC5B,EAAE;IACpB,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAChC,OAAO;YACL,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE;SACtC,CAAC;IACxB,CAAC;IAED,MAAM,UAAU,GACd,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ;QAC9B,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QACjD,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAExB,IAAI,OAAO,IAAI,EAAE,OAAO,KAAK,QAAQ,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;QACxC,IAAI,U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CAAC,CAAC;IAClD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,gBAAgB,IAAI,EAAE,EAAE,CAAC;QAChD,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;QACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC;QACvD,YAAY,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG;YAC9B,GAAG,KAAK;YACR,GAAG,QAAQ;YACX,YAAY,EAAE,WAAW;YACzB,IAAI,EACF,sBAAsB,CAAC,WAAW,CAAC;gBACnC,CAAC,MAAM,IAAI,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5C,CAAC;IACJ,CAAC;IAED,OAAO;QACL,GAAG,IAAI;QACP,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE,YAAY;KACzB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useExternalMessageConverter } from "@assistant-ui/react";
|
|
2
|
-
import { LangChainMessage } from "./types";
|
|
2
|
+
import { LangChainMessage } from "./types.js";
|
|
3
3
|
export declare const convertLangChainMessages: useExternalMessageConverter.Callback<LangChainMessage>;
|
|
4
4
|
//# sourceMappingURL=convertLangChainMessages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertLangChainMessages.d.ts","sourceRoot":"","sources":["../src/convertLangChainMessages.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"convertLangChainMessages.d.ts","sourceRoot":"","sources":["../src/convertLangChainMessages.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,mBAAgB;AAyF3C,eAAO,MAAM,wBAAwB,EAAE,2BAA2B,CAAC,QAAQ,CACzE,gBAAgB,CA6DjB,CAAC"}
|
|
@@ -1,120 +1,124 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
warnedMessagePartTypes.add(type);
|
|
13
|
-
console.warn(`Unknown message part type: ${type}`);
|
|
2
|
+
import { parsePartialJsonObject, } from "assistant-stream/utils";
|
|
3
|
+
const warnedMessagePartTypes = new Set();
|
|
4
|
+
const warnForUnknownMessagePartType = (type) => {
|
|
5
|
+
if (typeof process === "undefined" ||
|
|
6
|
+
process?.env?.["NODE_ENV"] !== "development")
|
|
7
|
+
return;
|
|
8
|
+
if (warnedMessagePartTypes.has(type))
|
|
9
|
+
return;
|
|
10
|
+
warnedMessagePartTypes.add(type);
|
|
11
|
+
console.warn(`Unknown message part type: ${type}`);
|
|
14
12
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
const contentToParts = (content) => {
|
|
14
|
+
if (typeof content === "string")
|
|
15
|
+
return [{ type: "text", text: content }];
|
|
16
|
+
return content
|
|
17
|
+
.map((part) => {
|
|
18
|
+
const type = part.type;
|
|
19
|
+
switch (type) {
|
|
20
|
+
case "text":
|
|
21
|
+
return { type: "text", text: part.text };
|
|
22
|
+
case "text_delta":
|
|
23
|
+
return { type: "text", text: part.text };
|
|
24
|
+
case "image_url":
|
|
25
|
+
if (typeof part.image_url === "string") {
|
|
26
|
+
return { type: "image", image: part.image_url };
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return {
|
|
30
|
+
type: "image",
|
|
31
|
+
image: part.image_url.url,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
case "file":
|
|
35
|
+
return {
|
|
36
|
+
type: "file",
|
|
37
|
+
filename: part.file.filename,
|
|
38
|
+
data: part.file.file_data,
|
|
39
|
+
mimeType: part.file.mime_type,
|
|
40
|
+
};
|
|
41
|
+
case "thinking":
|
|
42
|
+
return { type: "reasoning", text: part.thinking };
|
|
43
|
+
case "reasoning":
|
|
44
|
+
return {
|
|
45
|
+
type: "reasoning",
|
|
46
|
+
text: part.summary.map((s) => s.text).join("\n\n\n"),
|
|
47
|
+
};
|
|
48
|
+
case "tool_use":
|
|
49
|
+
return null;
|
|
50
|
+
case "input_json_delta":
|
|
51
|
+
return null;
|
|
52
|
+
case "computer_call":
|
|
53
|
+
return {
|
|
54
|
+
type: "tool-call",
|
|
55
|
+
toolCallId: part.call_id,
|
|
56
|
+
toolName: "computer_call",
|
|
57
|
+
args: part.action,
|
|
58
|
+
argsText: JSON.stringify(part.action),
|
|
59
|
+
};
|
|
60
|
+
default:
|
|
61
|
+
const _exhaustiveCheck = type;
|
|
62
|
+
warnForUnknownMessagePartType(_exhaustiveCheck);
|
|
63
|
+
return null;
|
|
64
|
+
// const _exhaustiveCheck: never = type;
|
|
65
|
+
// throw new Error(`Unknown message part type: ${_exhaustiveCheck}`);
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
.filter((a) => a !== null);
|
|
69
|
+
};
|
|
70
|
+
export const convertLangChainMessages = (message) => {
|
|
71
|
+
switch (message.type) {
|
|
72
|
+
case "system":
|
|
73
|
+
return {
|
|
74
|
+
role: "system",
|
|
75
|
+
id: message.id,
|
|
76
|
+
content: [{ type: "text", text: message.content }],
|
|
77
|
+
};
|
|
78
|
+
case "human":
|
|
79
|
+
return {
|
|
80
|
+
role: "user",
|
|
81
|
+
id: message.id,
|
|
82
|
+
content: contentToParts(message.content),
|
|
83
|
+
};
|
|
84
|
+
case "ai":
|
|
85
|
+
const toolCallParts = message.tool_calls?.map((chunk) => {
|
|
86
|
+
const argsText = chunk.partial_json ??
|
|
87
|
+
message.tool_call_chunks?.find((c) => c.id === chunk.id)?.args ??
|
|
88
|
+
JSON.stringify(chunk.args);
|
|
89
|
+
return {
|
|
90
|
+
type: "tool-call",
|
|
91
|
+
toolCallId: chunk.id,
|
|
92
|
+
toolName: chunk.name,
|
|
93
|
+
args: argsText
|
|
94
|
+
? (parsePartialJsonObject(argsText) ?? {})
|
|
95
|
+
: chunk.args,
|
|
96
|
+
argsText: argsText ?? JSON.stringify(chunk.args),
|
|
97
|
+
};
|
|
98
|
+
}) ?? [];
|
|
99
|
+
const normalizedContent = typeof message.content === "string"
|
|
100
|
+
? [{ type: "text", text: message.content }]
|
|
101
|
+
: message.content;
|
|
102
|
+
const allContent = [
|
|
103
|
+
message.additional_kwargs?.reasoning,
|
|
104
|
+
...normalizedContent,
|
|
105
|
+
...(message.additional_kwargs?.tool_outputs ?? []),
|
|
106
|
+
].filter((c) => c !== undefined);
|
|
30
107
|
return {
|
|
31
|
-
|
|
32
|
-
|
|
108
|
+
role: "assistant",
|
|
109
|
+
id: message.id,
|
|
110
|
+
content: [...contentToParts(allContent), ...toolCallParts],
|
|
111
|
+
...(message.status && { status: message.status }),
|
|
112
|
+
};
|
|
113
|
+
case "tool":
|
|
114
|
+
return {
|
|
115
|
+
role: "tool",
|
|
116
|
+
toolName: message.name,
|
|
117
|
+
toolCallId: message.tool_call_id,
|
|
118
|
+
result: message.content,
|
|
119
|
+
artifact: message.artifact,
|
|
120
|
+
isError: message.status === "error",
|
|
33
121
|
};
|
|
34
|
-
}
|
|
35
|
-
case "file":
|
|
36
|
-
return {
|
|
37
|
-
type: "file",
|
|
38
|
-
filename: part.file.filename,
|
|
39
|
-
data: part.file.file_data,
|
|
40
|
-
mimeType: part.file.mime_type
|
|
41
|
-
};
|
|
42
|
-
case "thinking":
|
|
43
|
-
return { type: "reasoning", text: part.thinking };
|
|
44
|
-
case "reasoning":
|
|
45
|
-
return {
|
|
46
|
-
type: "reasoning",
|
|
47
|
-
text: part.summary.map((s) => s.text).join("\n\n\n")
|
|
48
|
-
};
|
|
49
|
-
case "tool_use":
|
|
50
|
-
return null;
|
|
51
|
-
case "input_json_delta":
|
|
52
|
-
return null;
|
|
53
|
-
case "computer_call":
|
|
54
|
-
return {
|
|
55
|
-
type: "tool-call",
|
|
56
|
-
toolCallId: part.call_id,
|
|
57
|
-
toolName: "computer_call",
|
|
58
|
-
args: part.action,
|
|
59
|
-
argsText: JSON.stringify(part.action)
|
|
60
|
-
};
|
|
61
|
-
default:
|
|
62
|
-
const _exhaustiveCheck = type;
|
|
63
|
-
warnForUnknownMessagePartType(_exhaustiveCheck);
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
122
|
}
|
|
67
|
-
).filter((a) => a !== null);
|
|
68
|
-
};
|
|
69
|
-
var convertLangChainMessages = (message) => {
|
|
70
|
-
switch (message.type) {
|
|
71
|
-
case "system":
|
|
72
|
-
return {
|
|
73
|
-
role: "system",
|
|
74
|
-
id: message.id,
|
|
75
|
-
content: [{ type: "text", text: message.content }]
|
|
76
|
-
};
|
|
77
|
-
case "human":
|
|
78
|
-
return {
|
|
79
|
-
role: "user",
|
|
80
|
-
id: message.id,
|
|
81
|
-
content: contentToParts(message.content)
|
|
82
|
-
};
|
|
83
|
-
case "ai":
|
|
84
|
-
const toolCallParts = message.tool_calls?.map((chunk) => {
|
|
85
|
-
const argsText = chunk.partial_json ?? message.tool_call_chunks?.find((c) => c.id === chunk.id)?.args ?? JSON.stringify(chunk.args);
|
|
86
|
-
return {
|
|
87
|
-
type: "tool-call",
|
|
88
|
-
toolCallId: chunk.id,
|
|
89
|
-
toolName: chunk.name,
|
|
90
|
-
args: argsText ? parsePartialJsonObject(argsText) ?? {} : chunk.args,
|
|
91
|
-
argsText: argsText ?? JSON.stringify(chunk.args)
|
|
92
|
-
};
|
|
93
|
-
}) ?? [];
|
|
94
|
-
const normalizedContent = typeof message.content === "string" ? [{ type: "text", text: message.content }] : message.content;
|
|
95
|
-
const allContent = [
|
|
96
|
-
message.additional_kwargs?.reasoning,
|
|
97
|
-
...normalizedContent,
|
|
98
|
-
...message.additional_kwargs?.tool_outputs ?? []
|
|
99
|
-
].filter((c) => c !== void 0);
|
|
100
|
-
return {
|
|
101
|
-
role: "assistant",
|
|
102
|
-
id: message.id,
|
|
103
|
-
content: [...contentToParts(allContent), ...toolCallParts],
|
|
104
|
-
...message.status && { status: message.status }
|
|
105
|
-
};
|
|
106
|
-
case "tool":
|
|
107
|
-
return {
|
|
108
|
-
role: "tool",
|
|
109
|
-
toolName: message.name,
|
|
110
|
-
toolCallId: message.tool_call_id,
|
|
111
|
-
result: message.content,
|
|
112
|
-
artifact: message.artifact,
|
|
113
|
-
isError: message.status === "error"
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
export {
|
|
118
|
-
convertLangChainMessages
|
|
119
123
|
};
|
|
120
124
|
//# sourceMappingURL=convertLangChainMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"convertLangChainMessages.js","sourceRoot":"","sources":["../src/convertLangChainMessages.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AASb,OAAO,EACL,sBAAsB,GAEvB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAAU,CAAC;AACjD,MAAM,6BAA6B,GAAG,CAAC,IAAY,EAAE,EAAE;IACrD,IACE,OAAO,OAAO,KAAK,WAAW;QAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,aAAa;QAE5C,OAAO;IACT,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO;IAC7C,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;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BACjB,EAAE,EAAE,OAAO,CAAC,EAAE;gBACd,OAAO,EAAE,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,EAAE,GAAG,aAAa,CAAC;gBAC1D,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;aAClD,CAAC;QACJ,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,OAAO,CAAC,IAAI;gBACtB,UAAU,EAAE,OAAO,CAAC,YAAY;gBAChC,MAAM,EAAE,OAAO,CAAC,OAAO;gBACvB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,MAAM,KAAK,OAAO;aACpC,CAAC;IACN,CAAC;AACH,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { useLangGraphRuntime, useLangGraphSend, useLangGraphSendCommand, useLangGraphInterruptState, } from "./useLangGraphRuntime";
|
|
2
|
-
export { useLangGraphMessages, type LangGraphInterruptState, type LangGraphCommand, type LangGraphSendMessageConfig, type LangGraphStreamCallback, type LangGraphMessagesEvent, } from "./useLangGraphMessages";
|
|
3
|
-
export { convertLangChainMessages } from "./convertLangChainMessages";
|
|
4
|
-
export type { LangChainMessage, LangChainEvent, LangChainToolCall, LangChainToolCallChunk, } from "./types";
|
|
5
|
-
export { LangGraphMessageAccumulator } from "./LangGraphMessageAccumulator";
|
|
6
|
-
export { appendLangChainChunk } from "./appendLangChainChunk";
|
|
1
|
+
export { useLangGraphRuntime, useLangGraphSend, useLangGraphSendCommand, useLangGraphInterruptState, } from "./useLangGraphRuntime.js";
|
|
2
|
+
export { useLangGraphMessages, type LangGraphInterruptState, type LangGraphCommand, type LangGraphSendMessageConfig, type LangGraphStreamCallback, type LangGraphMessagesEvent, } from "./useLangGraphMessages.js";
|
|
3
|
+
export { convertLangChainMessages } from "./convertLangChainMessages.js";
|
|
4
|
+
export type { LangChainMessage, LangChainEvent, LangChainToolCall, LangChainToolCallChunk, } from "./types.js";
|
|
5
|
+
export { LangGraphMessageAccumulator } from "./LangGraphMessageAccumulator.js";
|
|
6
|
+
export { appendLangChainChunk } from "./appendLangChainChunk.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC3B,iCAA8B;AAE/B,OAAO,EACL,oBAAoB,EACpB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,GAC5B,kCAA+B;AAChC,OAAO,EAAE,wBAAwB,EAAE,sCAAmC;AAEtE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,GACvB,mBAAgB;AAEjB,OAAO,EAAE,2BAA2B,EAAE,yCAAsC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,kCAA+B"}
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
useLangGraphInterruptState
|
|
7
|
-
} from "./useLangGraphRuntime.js";
|
|
8
|
-
import {
|
|
9
|
-
useLangGraphMessages
|
|
10
|
-
} from "./useLangGraphMessages.js";
|
|
11
|
-
import { convertLangChainMessages } from "./convertLangChainMessages.js";
|
|
12
|
-
import { LangGraphMessageAccumulator } from "./LangGraphMessageAccumulator.js";
|
|
13
|
-
import { appendLangChainChunk } from "./appendLangChainChunk.js";
|
|
14
|
-
export {
|
|
15
|
-
LangGraphMessageAccumulator,
|
|
16
|
-
appendLangChainChunk,
|
|
17
|
-
convertLangChainMessages,
|
|
18
|
-
useLangGraphInterruptState,
|
|
19
|
-
useLangGraphMessages,
|
|
20
|
-
useLangGraphRuntime,
|
|
21
|
-
useLangGraphSend,
|
|
22
|
-
useLangGraphSendCommand
|
|
23
|
-
};
|
|
1
|
+
export { useLangGraphRuntime, useLangGraphSend, useLangGraphSendCommand, useLangGraphInterruptState, } from "./useLangGraphRuntime.js";
|
|
2
|
+
export { useLangGraphMessages, } from "./useLangGraphMessages.js";
|
|
3
|
+
export { convertLangChainMessages } from "./convertLangChainMessages.js";
|
|
4
|
+
export { LangGraphMessageAccumulator } from "./LangGraphMessageAccumulator.js";
|
|
5
|
+
export { appendLangChainChunk } from "./appendLangChainChunk.js";
|
|
24
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,0BAA0B,GAC3B,iCAA8B;AAE/B,OAAO,EACL,oBAAoB,GAMrB,kCAA+B;AAChC,OAAO,EAAE,wBAAwB,EAAE,sCAAmC;AAStE,OAAO,EAAE,2BAA2B,EAAE,yCAAsC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,kCAA+B"}
|
package/dist/testUtils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LangChainMessage } from "./types";
|
|
2
|
-
import { LangGraphMessagesEvent } from "./useLangGraphMessages";
|
|
1
|
+
import { LangChainMessage } from "./types.js";
|
|
2
|
+
import { LangGraphMessagesEvent } from "./useLangGraphMessages.js";
|
|
3
3
|
export declare const mockStreamCallbackFactory: (events: Array<LangGraphMessagesEvent<LangChainMessage>>) => () => AsyncGenerator<LangGraphMessagesEvent<LangChainMessage>, void, unknown>;
|
|
4
4
|
//# sourceMappingURL=testUtils.d.ts.map
|
package/dist/testUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../src/testUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../src/testUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,mBAAgB;AAC3C,OAAO,EAAE,sBAAsB,EAAE,kCAA+B;AAEhE,eAAO,MAAM,yBAAyB,GACpC,QAAQ,KAAK,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,CAAC,kFAMtD,CAAC"}
|