@langchain/anthropic 0.3.27 → 0.3.28

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.
@@ -141,7 +141,6 @@ const standardContentBlockConverter = {
141
141
  source: {
142
142
  type: "url",
143
143
  url: block.url,
144
- media_type: block.mime_type ?? "",
145
144
  },
146
145
  ...("cache_control" in (block.metadata ?? {})
147
146
  ? { cache_control: block.metadata.cache_control }
@@ -137,7 +137,6 @@ const standardContentBlockConverter = {
137
137
  source: {
138
138
  type: "url",
139
139
  url: block.url,
140
- media_type: block.mime_type ?? "",
141
140
  },
142
141
  ...("cache_control" in (block.metadata ?? {})
143
142
  ? { cache_control: block.metadata.cache_control }
@@ -15,6 +15,11 @@ function handleToolChoice(toolChoice) {
15
15
  type: "auto",
16
16
  };
17
17
  }
18
+ else if (toolChoice === "none") {
19
+ return {
20
+ type: "none",
21
+ };
22
+ }
18
23
  else if (typeof toolChoice === "string") {
19
24
  return {
20
25
  type: "tool",
@@ -1,3 +1,3 @@
1
1
  import type { Anthropic } from "@anthropic-ai/sdk";
2
2
  import { AnthropicToolChoice } from "../types.js";
3
- export declare function handleToolChoice(toolChoice?: AnthropicToolChoice): Anthropic.Messages.ToolChoiceAuto | Anthropic.Messages.ToolChoiceAny | Anthropic.Messages.ToolChoiceTool | undefined;
3
+ export declare function handleToolChoice(toolChoice?: AnthropicToolChoice): Anthropic.Messages.ToolChoiceAuto | Anthropic.Messages.ToolChoiceAny | Anthropic.Messages.ToolChoiceTool | Anthropic.Messages.ToolChoiceNone | undefined;
@@ -12,6 +12,11 @@ export function handleToolChoice(toolChoice) {
12
12
  type: "auto",
13
13
  };
14
14
  }
15
+ else if (toolChoice === "none") {
16
+ return {
17
+ type: "none",
18
+ };
19
+ }
15
20
  else if (typeof toolChoice === "string") {
16
21
  return {
17
22
  type: "tool",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "0.3.27",
3
+ "version": "0.3.28",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {