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