@langchain/anthropic 0.3.15 → 0.3.17

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.
@@ -642,7 +642,9 @@ class ChatAnthropicMessages extends chat_models_1.BaseChatModel {
642
642
  return {
643
643
  name: tool.name,
644
644
  description: tool.description,
645
- input_schema: (0, zod_to_json_schema_1.zodToJsonSchema)(tool.schema),
645
+ input_schema: ((0, types_1.isZodSchema)(tool.schema)
646
+ ? (0, zod_to_json_schema_1.zodToJsonSchema)(tool.schema)
647
+ : tool.schema),
646
648
  };
647
649
  }
648
650
  throw new Error(`Unknown tool type passed to ChatAnthropic: ${JSON.stringify(tool, null, 2)}`);
@@ -639,7 +639,9 @@ export class ChatAnthropicMessages extends BaseChatModel {
639
639
  return {
640
640
  name: tool.name,
641
641
  description: tool.description,
642
- input_schema: zodToJsonSchema(tool.schema),
642
+ input_schema: (isZodSchema(tool.schema)
643
+ ? zodToJsonSchema(tool.schema)
644
+ : tool.schema),
643
645
  };
644
646
  }
645
647
  throw new Error(`Unknown tool type passed to ChatAnthropic: ${JSON.stringify(tool, null, 2)}`);
@@ -155,7 +155,7 @@ function _formatContent(content) {
155
155
  contentPartCopy.input = JSON.parse(contentPartCopy.input);
156
156
  }
157
157
  catch {
158
- // no-op
158
+ contentPartCopy.input = {};
159
159
  }
160
160
  }
161
161
  // TODO: Fix when SDK types are fixed
@@ -151,7 +151,7 @@ function _formatContent(content) {
151
151
  contentPartCopy.input = JSON.parse(contentPartCopy.input);
152
152
  }
153
153
  catch {
154
- // no-op
154
+ contentPartCopy.input = {};
155
155
  }
156
156
  }
157
157
  // 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.15",
3
+ "version": "0.3.17",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {