@langchain/anthropic 0.3.17 → 0.3.18
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.
|
@@ -151,11 +151,13 @@ function _formatContent(content) {
|
|
|
151
151
|
}
|
|
152
152
|
if ("input" in contentPartCopy) {
|
|
153
153
|
// Anthropic tool use inputs should be valid objects, when applicable.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
if (typeof contentPartCopy.input === "string") {
|
|
155
|
+
try {
|
|
156
|
+
contentPartCopy.input = JSON.parse(contentPartCopy.input);
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
contentPartCopy.input = {};
|
|
160
|
+
}
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
163
|
// TODO: Fix when SDK types are fixed
|
|
@@ -147,11 +147,13 @@ function _formatContent(content) {
|
|
|
147
147
|
}
|
|
148
148
|
if ("input" in contentPartCopy) {
|
|
149
149
|
// Anthropic tool use inputs should be valid objects, when applicable.
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
if (typeof contentPartCopy.input === "string") {
|
|
151
|
+
try {
|
|
152
|
+
contentPartCopy.input = JSON.parse(contentPartCopy.input);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
contentPartCopy.input = {};
|
|
156
|
+
}
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
// TODO: Fix when SDK types are fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langchain/anthropic",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.18",
|
|
4
4
|
"description": "Anthropic integrations for LangChain.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"jest": "^29.5.0",
|
|
63
63
|
"jest-environment-node": "^29.6.4",
|
|
64
64
|
"prettier": "^2.8.3",
|
|
65
|
-
"release-it": "^
|
|
65
|
+
"release-it": "^18.1.2",
|
|
66
66
|
"rimraf": "^5.0.1",
|
|
67
67
|
"ts-jest": "^29.1.0",
|
|
68
68
|
"typescript": "~5.1.6"
|