@langchain/anthropic 0.1.11 → 0.1.12

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.
@@ -422,13 +422,11 @@ class ChatAnthropicMessages extends chat_models_1.BaseChatModel {
422
422
  text: contentPart.text,
423
423
  };
424
424
  }
425
- else if (contentPart.type === "tool_use") {
425
+ else if (contentPart.type === "tool_use" ||
426
+ contentPart.type === "tool_result") {
426
427
  // TODO: Fix when SDK types are fixed
427
428
  return {
428
- type: "tool_use",
429
- id: contentPart.id,
430
- name: contentPart.name,
431
- input: contentPart.input,
429
+ ...contentPart,
432
430
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
433
431
  };
434
432
  }
@@ -419,13 +419,11 @@ export class ChatAnthropicMessages extends BaseChatModel {
419
419
  text: contentPart.text,
420
420
  };
421
421
  }
422
- else if (contentPart.type === "tool_use") {
422
+ else if (contentPart.type === "tool_use" ||
423
+ contentPart.type === "tool_result") {
423
424
  // TODO: Fix when SDK types are fixed
424
425
  return {
425
- type: "tool_use",
426
- id: contentPart.id,
427
- name: contentPart.name,
428
- input: contentPart.input,
426
+ ...contentPart,
429
427
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
430
428
  };
431
429
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {