@langchain/anthropic 0.2.6 → 0.2.7
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/chat_models.cjs +9 -3
- package/dist/chat_models.js +9 -3
- package/package.json +1 -1
package/dist/chat_models.cjs
CHANGED
|
@@ -406,9 +406,15 @@ function extractToolCallChunk(chunk) {
|
|
|
406
406
|
return newToolCallChunk;
|
|
407
407
|
}
|
|
408
408
|
function extractToken(chunk) {
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
409
|
+
if (typeof chunk.content === "string") {
|
|
410
|
+
return chunk.content;
|
|
411
|
+
}
|
|
412
|
+
else if (Array.isArray(chunk.content) && "input" in chunk.content[0]) {
|
|
413
|
+
return typeof chunk.content[0].input === "string"
|
|
414
|
+
? chunk.content[0].input
|
|
415
|
+
: JSON.stringify(chunk.content[0].input);
|
|
416
|
+
}
|
|
417
|
+
return undefined;
|
|
412
418
|
}
|
|
413
419
|
function extractToolUseContent(chunk, concatenatedChunks) {
|
|
414
420
|
let newConcatenatedChunks = concatenatedChunks;
|
package/dist/chat_models.js
CHANGED
|
@@ -402,9 +402,15 @@ function extractToolCallChunk(chunk) {
|
|
|
402
402
|
return newToolCallChunk;
|
|
403
403
|
}
|
|
404
404
|
function extractToken(chunk) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
if (typeof chunk.content === "string") {
|
|
406
|
+
return chunk.content;
|
|
407
|
+
}
|
|
408
|
+
else if (Array.isArray(chunk.content) && "input" in chunk.content[0]) {
|
|
409
|
+
return typeof chunk.content[0].input === "string"
|
|
410
|
+
? chunk.content[0].input
|
|
411
|
+
: JSON.stringify(chunk.content[0].input);
|
|
412
|
+
}
|
|
413
|
+
return undefined;
|
|
408
414
|
}
|
|
409
415
|
function extractToolUseContent(chunk, concatenatedChunks) {
|
|
410
416
|
let newConcatenatedChunks = concatenatedChunks;
|