@langchain/anthropic 1.0.0 → 1.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.js","names":["PROFILES: Record<string, ModelProfile>"],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"claude-opus-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-sonnet-20240620\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-opus-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-5-20250929\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-20250514\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-5-haiku-20241022\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-haiku-20240307\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-20250219\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-7-sonnet-latest\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-sonnet-4-0\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-opus-4-1-20250805\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 32000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-3-sonnet-20240229\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n \"claude-haiku-4-5-20251001\": {\n maxInputTokens: 200000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: true,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n imageUrlInputs: true,\n pdfToolMessage: true,\n imageToolMessage: true,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAMA,WAAyC;CAC7C,mBAAmB;EACjB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa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ChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;CACnB;AACF;AACD,uBAAe"}
package/dist/types.d.cts CHANGED
@@ -14,6 +14,7 @@ type AnthropicToolChoice = {
14
14
  name: string;
15
15
  } | "any" | "auto" | "none" | string;
16
16
  type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;
17
+ type ChatAnthropicOutputFormat = Anthropic.Beta.BetaJSONOutputFormat;
17
18
  type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;
18
19
  type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;
19
20
  type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;
@@ -29,5 +30,5 @@ type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBloc
29
30
  // Union of all possible content block types including server tool use
30
31
  type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;
31
32
  //#endregion
32
- export { AnthropicContextManagementConfigParam, AnthropicMessageCreateParams, AnthropicMessageStreamEvent, AnthropicRequestOptions, AnthropicStreamingMessageCreateParams, AnthropicThinkingConfigParam, AnthropicToolChoice, ChatAnthropicContentBlock, ChatAnthropicToolType };
33
+ export { AnthropicContextManagementConfigParam, AnthropicMessageCreateParams, AnthropicMessageStreamEvent, AnthropicRequestOptions, AnthropicStreamingMessageCreateParams, AnthropicThinkingConfigParam, AnthropicToolChoice, ChatAnthropicContentBlock, ChatAnthropicOutputFormat, ChatAnthropicToolType };
33
34
  //# sourceMappingURL=types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":["Anthropic","BindToolsInput","AnthropicToolResponse","Record","AnthropicMessageParam","MessageParam","AnthropicMessageResponse","ContentBlock","AnthropicMessageCreateParams","MessageCreateParamsNonStreaming","AnthropicStreamingMessageCreateParams","MessageCreateParamsStreaming","AnthropicThinkingConfigParam","ThinkingConfigParam","AnthropicContextManagementConfigParam","Beta","BetaContextManagementConfig","AnthropicMessageStreamEvent","MessageStreamEvent","AnthropicRequestOptions","RequestOptions","AnthropicToolChoice","ChatAnthropicToolType","Messages","Tool","AnthropicTextBlockParam","TextBlockParam","AnthropicImageBlockParam","ImageBlockParam","AnthropicToolUseBlockParam","ToolUseBlockParam","AnthropicToolResultBlockParam","ToolResultBlockParam","AnthropicDocumentBlockParam","DocumentBlockParam","AnthropicThinkingBlockParam","ThinkingBlockParam","AnthropicRedactedThinkingBlockParam","RedactedThinkingBlockParam","AnthropicServerToolUseBlockParam","ServerToolUseBlockParam","AnthropicWebSearchToolResultBlockParam","WebSearchToolResultBlockParam","AnthropicWebSearchResultBlockParam","WebSearchResultBlockParam","AnthropicSearchResultBlockParam","SearchResultBlockParam","AnthropicContainerUploadBlockParam","BetaContainerUploadBlockParam","ChatAnthropicContentBlock","isAnthropicImageBlockParam","AnthropicBuiltInToolUnion","ToolUnion","Exclude"],"sources":["../src/types.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nexport type AnthropicToolResponse = {\n type: \"tool_use\";\n id: string;\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input: Record<string, any>;\n};\nexport type AnthropicMessageParam = Anthropic.MessageParam;\nexport type AnthropicMessageResponse = Anthropic.ContentBlock | AnthropicToolResponse;\nexport type AnthropicMessageCreateParams = Anthropic.MessageCreateParamsNonStreaming;\nexport type AnthropicStreamingMessageCreateParams = Anthropic.MessageCreateParamsStreaming;\nexport type AnthropicThinkingConfigParam = Anthropic.ThinkingConfigParam;\nexport type AnthropicContextManagementConfigParam = Anthropic.Beta.BetaContextManagementConfig;\nexport type AnthropicMessageStreamEvent = Anthropic.MessageStreamEvent;\nexport type AnthropicRequestOptions = Anthropic.RequestOptions;\nexport type AnthropicToolChoice = {\n type: \"tool\";\n name: string;\n} | \"any\" | \"auto\" | \"none\" | string;\nexport type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;\nexport type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;\nexport type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;\nexport type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;\nexport type AnthropicToolResultBlockParam = Anthropic.Messages.ToolResultBlockParam;\nexport type AnthropicDocumentBlockParam = Anthropic.Messages.DocumentBlockParam;\nexport type AnthropicThinkingBlockParam = Anthropic.Messages.ThinkingBlockParam;\nexport type AnthropicRedactedThinkingBlockParam = Anthropic.Messages.RedactedThinkingBlockParam;\nexport type AnthropicServerToolUseBlockParam = Anthropic.Messages.ServerToolUseBlockParam;\nexport type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolResultBlockParam;\nexport type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;\nexport type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;\nexport type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;\n// Union of all possible content block types including server tool use\nexport type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;\nexport declare function isAnthropicImageBlockParam(block: unknown): block is AnthropicImageBlockParam;\n// Type for built-in tools only (excludes custom Tool type)\nexport type AnthropicBuiltInToolUnion = Exclude<Anthropic.Messages.ToolUnion, Anthropic.Messages.Tool>;\n"],"mappings":";;;;;AAqBYsB,KAVAd,4BAAAA,GAA+BR,SAAAA,CAAUS,+BAUpB;AAAA,KATrBC,qCAAAA,GAAwCV,SAAAA,CAAUW,4BAS7B;AAAGX,KARxBY,4BAAAA,GAA+BZ,SAAAA,CAAUa,mBAQEW;AAAOvB,KAPlDa,qCAAAA,GAAwCd,SAAAA,CAAUe,IAAAA,CAAKC,2BAOLf;AAAc,KANhEgB,2BAAAA,GAA8BjB,SAAAA,CAAUkB,kBAMwB;AAChEO,KANAN,uBAAAA,GAA0BnB,SAAAA,CAAUoB,cAMSM;AAC7CC,KANAN,mBAAAA,GAMwB;EACxBQ,IAAAA,EAAAA,MAAAA;EACAE,IAAAA,EAAAA,MAAAA;AACZ,CAAA,GAAYE,KAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAA2B;AAC3BE,KANAb,qBAAAA,GAAwBtB,SAAAA,CAAUuB,QAAAA,CAASC,IAMHD,GANUtB,cAMDmC;AACjDC,KANAZ,uBAAAA,GAA0BzB,SAAAA,CAAUuB,QAAAA,CAASG,cAMGH;AAChDgB,KANAZ,wBAAAA,GAA2B3B,SAAAA,CAAUuB,QAAAA,CAASK,eAMQY;AACtDC,KANAZ,0BAAAA,GAA6B7B,SAAAA,CAAUuB,QAAAA,CAASO,iBAMYY;AAC5DC,KANAZ,6BAAAA,GAAgC/B,SAAAA,CAAUuB,QAAAA,CAASS,oBAMKY;AACxDC,KANAZ,2BAAAA,GAA8BjC,SAAAA,CAAUuB,QAAAA,CAASW,kBAMLY;AAC5CC,KANAZ,2BAAAA,GAA8BnC,SAAAA,CAAUuB,QAAAA,CAASa,kBAMGY;AAEpDC,KAPAZ,mCAAAA,GAAsCrC,SAAAA,CAAUuB,QAAAA,CAASe,0BAOhC;AAAA,KANzBC,gCAAAA,GAAmCvC,SAAAA,CAAUuB,QAAAA,CAASiB,uBAM7B;AAAGf,KAL5BgB,sCAAAA,GAAyCzC,SAAAA,CAAUuB,QAAAA,CAASmB,6BAKhCjB;AAA0BE,KAJtDgB,kCAAAA,GAAqC3C,SAAAA,CAAUuB,QAAAA,CAASqB,yBAIFjB;AAA2BE,KAHjFgB,+BAAAA,GAAkC7C,SAAAA,CAAU8C,sBAGqCjB;AAA6BE,KAF9GgB,kCAAAA,GAAqC/C,SAAAA,CAAUe,IAAAA,CAAKiC,6BAE0DjB;;AAA8DI,KAA5Kc,yBAAAA,GAA4BxB,uBAAgJU,GAAtHR,wBAAsHQ,GAA3FN,0BAA2FM,GAA9DJ,6BAA8DI,GAA9BF,2BAA8BE,GAAAA,2BAAAA,GAA8BE,mCAA9BF,GAAoEI,gCAApEJ,GAAuGM,sCAAvGN,GAAgJQ,kCAAhJR,GAAqLU,+BAArLV,GAAuNY,kCAAvNZ"}
1
+ {"version":3,"file":"types.d.cts","names":["Anthropic","BindToolsInput","AnthropicToolResponse","Record","AnthropicMessageParam","MessageParam","AnthropicMessageResponse","ContentBlock","AnthropicMessageCreateParams","MessageCreateParamsNonStreaming","AnthropicStreamingMessageCreateParams","MessageCreateParamsStreaming","AnthropicThinkingConfigParam","ThinkingConfigParam","AnthropicContextManagementConfigParam","Beta","BetaContextManagementConfig","AnthropicMessageStreamEvent","MessageStreamEvent","AnthropicRequestOptions","RequestOptions","AnthropicToolChoice","ChatAnthropicToolType","Messages","Tool","ChatAnthropicOutputFormat","BetaJSONOutputFormat","AnthropicTextBlockParam","TextBlockParam","AnthropicImageBlockParam","ImageBlockParam","AnthropicToolUseBlockParam","ToolUseBlockParam","AnthropicToolResultBlockParam","ToolResultBlockParam","AnthropicDocumentBlockParam","DocumentBlockParam","AnthropicThinkingBlockParam","ThinkingBlockParam","AnthropicRedactedThinkingBlockParam","RedactedThinkingBlockParam","AnthropicServerToolUseBlockParam","ServerToolUseBlockParam","AnthropicWebSearchToolResultBlockParam","WebSearchToolResultBlockParam","AnthropicWebSearchResultBlockParam","WebSearchResultBlockParam","AnthropicSearchResultBlockParam","SearchResultBlockParam","AnthropicContainerUploadBlockParam","BetaContainerUploadBlockParam","ChatAnthropicContentBlock","isAnthropicImageBlockParam","AnthropicBuiltInToolUnion","ToolUnion","Exclude"],"sources":["../src/types.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nexport type AnthropicToolResponse = {\n type: \"tool_use\";\n id: string;\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input: Record<string, any>;\n};\nexport type AnthropicMessageParam = Anthropic.MessageParam;\nexport type AnthropicMessageResponse = Anthropic.ContentBlock | AnthropicToolResponse;\nexport type AnthropicMessageCreateParams = Anthropic.MessageCreateParamsNonStreaming;\nexport type AnthropicStreamingMessageCreateParams = Anthropic.MessageCreateParamsStreaming;\nexport type AnthropicThinkingConfigParam = Anthropic.ThinkingConfigParam;\nexport type AnthropicContextManagementConfigParam = Anthropic.Beta.BetaContextManagementConfig;\nexport type AnthropicMessageStreamEvent = Anthropic.MessageStreamEvent;\nexport type AnthropicRequestOptions = Anthropic.RequestOptions;\nexport type AnthropicToolChoice = {\n type: \"tool\";\n name: string;\n} | \"any\" | \"auto\" | \"none\" | string;\nexport type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;\nexport type ChatAnthropicOutputFormat = Anthropic.Beta.BetaJSONOutputFormat;\nexport type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;\nexport type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;\nexport type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;\nexport type AnthropicToolResultBlockParam = Anthropic.Messages.ToolResultBlockParam;\nexport type AnthropicDocumentBlockParam = Anthropic.Messages.DocumentBlockParam;\nexport type AnthropicThinkingBlockParam = Anthropic.Messages.ThinkingBlockParam;\nexport type AnthropicRedactedThinkingBlockParam = Anthropic.Messages.RedactedThinkingBlockParam;\nexport type AnthropicServerToolUseBlockParam = Anthropic.Messages.ServerToolUseBlockParam;\nexport type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolResultBlockParam;\nexport type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;\nexport type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;\nexport type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;\n// Union of all possible content block types including server tool use\nexport type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;\nexport declare function isAnthropicImageBlockParam(block: unknown): block is AnthropicImageBlockParam;\n// Type for built-in tools only (excludes custom Tool type)\nexport type AnthropicBuiltInToolUnion = Exclude<Anthropic.Messages.ToolUnion, Anthropic.Messages.Tool>;\n"],"mappings":";;;;;AAqBYsB,KAVAd,4BAAAA,GAA+BR,SAAAA,CAAUS,+BAUpB;AAAA,KATrBC,qCAAAA,GAAwCV,SAAAA,CAAUW,4BAS7B;AAAGX,KARxBY,4BAAAA,GAA+BZ,SAAAA,CAAUa,mBAQEW;AAAOvB,KAPlDa,qCAAAA,GAAwCd,SAAAA,CAAUe,IAAAA,CAAKC,2BAOLf;AAAc,KANhEgB,2BAAAA,GAA8BjB,SAAAA,CAAUkB,kBAMwB;AAChEO,KANAN,uBAAAA,GAA0BnB,SAAAA,CAAUoB,cAMOM;AAC3CC,KANAN,mBAAAA,GAMuB;EACvBQ,IAAAA,EAAAA,MAAAA;EACAE,IAAAA,EAAAA,MAAAA;AACZ,CAAA,GAAYE,KAAAA,GAAAA,MAAAA,GAAA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,kCAAhJR,GAAqLU,+BAArLV,GAAuNY,kCAAvNZ"}
package/dist/types.d.ts CHANGED
@@ -14,6 +14,7 @@ type AnthropicToolChoice = {
14
14
  name: string;
15
15
  } | "any" | "auto" | "none" | string;
16
16
  type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;
17
+ type ChatAnthropicOutputFormat = Anthropic.Beta.BetaJSONOutputFormat;
17
18
  type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;
18
19
  type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;
19
20
  type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;
@@ -29,5 +30,5 @@ type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBloc
29
30
  // Union of all possible content block types including server tool use
30
31
  type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;
31
32
  //#endregion
32
- export { AnthropicContextManagementConfigParam, AnthropicMessageCreateParams, AnthropicMessageStreamEvent, AnthropicRequestOptions, AnthropicStreamingMessageCreateParams, AnthropicThinkingConfigParam, AnthropicToolChoice, ChatAnthropicContentBlock, ChatAnthropicToolType };
33
+ export { AnthropicContextManagementConfigParam, AnthropicMessageCreateParams, AnthropicMessageStreamEvent, AnthropicRequestOptions, AnthropicStreamingMessageCreateParams, AnthropicThinkingConfigParam, AnthropicToolChoice, ChatAnthropicContentBlock, ChatAnthropicOutputFormat, ChatAnthropicToolType };
33
34
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":["Anthropic","BindToolsInput","AnthropicToolResponse","Record","AnthropicMessageParam","MessageParam","AnthropicMessageResponse","ContentBlock","AnthropicMessageCreateParams","MessageCreateParamsNonStreaming","AnthropicStreamingMessageCreateParams","MessageCreateParamsStreaming","AnthropicThinkingConfigParam","ThinkingConfigParam","AnthropicContextManagementConfigParam","Beta","BetaContextManagementConfig","AnthropicMessageStreamEvent","MessageStreamEvent","AnthropicRequestOptions","RequestOptions","AnthropicToolChoice","ChatAnthropicToolType","Messages","Tool","AnthropicTextBlockParam","TextBlockParam","AnthropicImageBlockParam","ImageBlockParam","AnthropicToolUseBlockParam","ToolUseBlockParam","AnthropicToolResultBlockParam","ToolResultBlockParam","AnthropicDocumentBlockParam","DocumentBlockParam","AnthropicThinkingBlockParam","ThinkingBlockParam","AnthropicRedactedThinkingBlockParam","RedactedThinkingBlockParam","AnthropicServerToolUseBlockParam","ServerToolUseBlockParam","AnthropicWebSearchToolResultBlockParam","WebSearchToolResultBlockParam","AnthropicWebSearchResultBlockParam","WebSearchResultBlockParam","AnthropicSearchResultBlockParam","SearchResultBlockParam","AnthropicContainerUploadBlockParam","BetaContainerUploadBlockParam","ChatAnthropicContentBlock","isAnthropicImageBlockParam","AnthropicBuiltInToolUnion","ToolUnion","Exclude"],"sources":["../src/types.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nexport type AnthropicToolResponse = {\n type: \"tool_use\";\n id: string;\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input: Record<string, any>;\n};\nexport type AnthropicMessageParam = Anthropic.MessageParam;\nexport type AnthropicMessageResponse = Anthropic.ContentBlock | AnthropicToolResponse;\nexport type AnthropicMessageCreateParams = Anthropic.MessageCreateParamsNonStreaming;\nexport type AnthropicStreamingMessageCreateParams = Anthropic.MessageCreateParamsStreaming;\nexport type AnthropicThinkingConfigParam = Anthropic.ThinkingConfigParam;\nexport type AnthropicContextManagementConfigParam = Anthropic.Beta.BetaContextManagementConfig;\nexport type AnthropicMessageStreamEvent = Anthropic.MessageStreamEvent;\nexport type AnthropicRequestOptions = Anthropic.RequestOptions;\nexport type AnthropicToolChoice = {\n type: \"tool\";\n name: string;\n} | \"any\" | \"auto\" | \"none\" | string;\nexport type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;\nexport type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;\nexport type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;\nexport type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;\nexport type AnthropicToolResultBlockParam = Anthropic.Messages.ToolResultBlockParam;\nexport type AnthropicDocumentBlockParam = Anthropic.Messages.DocumentBlockParam;\nexport type AnthropicThinkingBlockParam = Anthropic.Messages.ThinkingBlockParam;\nexport type AnthropicRedactedThinkingBlockParam = Anthropic.Messages.RedactedThinkingBlockParam;\nexport type AnthropicServerToolUseBlockParam = Anthropic.Messages.ServerToolUseBlockParam;\nexport type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolResultBlockParam;\nexport type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;\nexport type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;\nexport type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;\n// Union of all possible content block types including server tool use\nexport type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;\nexport declare function isAnthropicImageBlockParam(block: unknown): block is AnthropicImageBlockParam;\n// Type for built-in tools only (excludes custom Tool type)\nexport type AnthropicBuiltInToolUnion = Exclude<Anthropic.Messages.ToolUnion, Anthropic.Messages.Tool>;\n"],"mappings":";;;;;AAqBYsB,KAVAd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AAA,GAAqC3C,SAAAA,CAAUuB,QAAAA,CAASqB,yBAIFjB;AAA2BE,KAHjFgB,+BAAAA,GAAkC7C,SAAAA,CAAU8C,sBAGqCjB;AAA6BE,KAF9GgB,kCAAAA,GAAqC/C,SAAAA,CAAUe,IAAAA,CAAKiC,6BAE0DjB;;AAA8DI,KAA5Kc,yBAAAA,GAA4BxB,uBAAgJU,GAAtHR,wBAAsHQ,GAA3FN,0BAA2FM,GAA9DJ,6BAA8DI,GAA9BF,2BAA8BE,GAAAA,2BAAAA,GAA8BE,mCAA9BF,GAAoEI,gCAApEJ,GAAuGM,sCAAvGN,GAAgJQ,kCAAhJR,GAAqLU,+BAArLV,GAAuNY,kCAAvNZ"}
1
+ {"version":3,"file":"types.d.ts","names":["Anthropic","BindToolsInput","AnthropicToolResponse","Record","AnthropicMessageParam","MessageParam","AnthropicMessageResponse","ContentBlock","AnthropicMessageCreateParams","MessageCreateParamsNonStreaming","AnthropicStreamingMessageCreateParams","MessageCreateParamsStreaming","AnthropicThinkingConfigParam","ThinkingConfigParam","AnthropicContextManagementConfigParam","Beta","BetaContextManagementConfig","AnthropicMessageStreamEvent","MessageStreamEvent","AnthropicRequestOptions","RequestOptions","AnthropicToolChoice","ChatAnthropicToolType","Messages","Tool","ChatAnthropicOutputFormat","BetaJSONOutputFormat","AnthropicTextBlockParam","TextBlockParam","AnthropicImageBlockParam","ImageBlockParam","AnthropicToolUseBlockParam","ToolUseBlockParam","AnthropicToolResultBlockParam","ToolResultBlockParam","AnthropicDocumentBlockParam","DocumentBlockParam","AnthropicThinkingBlockParam","ThinkingBlockParam","AnthropicRedactedThinkingBlockParam","RedactedThinkingBlockParam","AnthropicServerToolUseBlockParam","ServerToolUseBlockParam","AnthropicWebSearchToolResultBlockParam","WebSearchToolResultBlockParam","AnthropicWebSearchResultBlockParam","WebSearchResultBlockParam","AnthropicSearchResultBlockParam","SearchResultBlockParam","AnthropicContainerUploadBlockParam","BetaContainerUploadBlockParam","ChatAnthropicContentBlock","isAnthropicImageBlockParam","AnthropicBuiltInToolUnion","ToolUnion","Exclude"],"sources":["../src/types.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { BindToolsInput } from \"@langchain/core/language_models/chat_models\";\nexport type AnthropicToolResponse = {\n type: \"tool_use\";\n id: string;\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n input: Record<string, any>;\n};\nexport type AnthropicMessageParam = Anthropic.MessageParam;\nexport type AnthropicMessageResponse = Anthropic.ContentBlock | AnthropicToolResponse;\nexport type AnthropicMessageCreateParams = Anthropic.MessageCreateParamsNonStreaming;\nexport type AnthropicStreamingMessageCreateParams = Anthropic.MessageCreateParamsStreaming;\nexport type AnthropicThinkingConfigParam = Anthropic.ThinkingConfigParam;\nexport type AnthropicContextManagementConfigParam = Anthropic.Beta.BetaContextManagementConfig;\nexport type AnthropicMessageStreamEvent = Anthropic.MessageStreamEvent;\nexport type AnthropicRequestOptions = Anthropic.RequestOptions;\nexport type AnthropicToolChoice = {\n type: \"tool\";\n name: string;\n} | \"any\" | \"auto\" | \"none\" | string;\nexport type ChatAnthropicToolType = Anthropic.Messages.Tool | BindToolsInput;\nexport type ChatAnthropicOutputFormat = Anthropic.Beta.BetaJSONOutputFormat;\nexport type AnthropicTextBlockParam = Anthropic.Messages.TextBlockParam;\nexport type AnthropicImageBlockParam = Anthropic.Messages.ImageBlockParam;\nexport type AnthropicToolUseBlockParam = Anthropic.Messages.ToolUseBlockParam;\nexport type AnthropicToolResultBlockParam = Anthropic.Messages.ToolResultBlockParam;\nexport type AnthropicDocumentBlockParam = Anthropic.Messages.DocumentBlockParam;\nexport type AnthropicThinkingBlockParam = Anthropic.Messages.ThinkingBlockParam;\nexport type AnthropicRedactedThinkingBlockParam = Anthropic.Messages.RedactedThinkingBlockParam;\nexport type AnthropicServerToolUseBlockParam = Anthropic.Messages.ServerToolUseBlockParam;\nexport type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolResultBlockParam;\nexport type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;\nexport type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;\nexport type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;\n// Union of all possible content block types including server tool use\nexport type ChatAnthropicContentBlock = AnthropicTextBlockParam | AnthropicImageBlockParam | AnthropicToolUseBlockParam | AnthropicToolResultBlockParam | AnthropicDocumentBlockParam | AnthropicThinkingBlockParam | AnthropicRedactedThinkingBlockParam | AnthropicServerToolUseBlockParam | AnthropicWebSearchToolResultBlockParam | AnthropicWebSearchResultBlockParam | AnthropicSearchResultBlockParam | AnthropicContainerUploadBlockParam;\nexport declare function isAnthropicImageBlockParam(block: unknown): block is AnthropicImageBlockParam;\n// Type for built-in tools only (excludes custom Tool type)\nexport type AnthropicBuiltInToolUnion = Exclude<Anthropic.Messages.ToolUnion, Anthropic.Messages.Tool>;\n"],"mappings":";;;;;AAqBYsB,KAVAd,4BAAAA,GAA+BR,SAAAA,CAAUS,+BAUpB;AAAA,KATrBC,qCAAAA,GAAwCV,SAAAA,CAAUW,4BAS7B;AAAGX,KARxBY,4BAAAA,GAA+BZ,SAAAA,CAAUa,mBAQEW;AAAOvB,KAPlDa,qCAAAA,GAAwCd,SAAAA,CAAUe,IAAAA,CAAKC,2BAOLf;AAAc,KANhEgB,2BAAAA,GAA8BjB,SAAAA,CAAUkB,kBAMwB;AAChEO,KANAN,uBAAAA,GAA0BnB,SAAAA,CAAUoB,cAMOM;AAC3CC,KANAN,mBAAAA,GAMuB;EACvBQ,IAAAA,EAAAA,MAAAA;EACAE,IAAAA,EAAAA,MAAAA;AACZ,CAAA,GAAYE,KAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAA6B;AAC7BE,KANAb,qBAAAA,GAAwBtB,SAAAA,CAAUuB,QAAAA,CAASC,IAMHD,GANUtB,cAMDmC;AACjDC,KANAZ,yBAAAA,GAA4BzB,SAAAA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_code;
5
- error.message = `${error.message}\n\nTroubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${lc_error_code}/\n`;
5
+ error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
6
6
  return error;
7
7
  }
8
8
  function wrapAnthropicClientError(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";;AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,8EAA8E,EAAE,cAAc,GAAG,CAAC;AACnI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
1
+ {"version":3,"file":"errors.cjs","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";;AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,oFAAoF,EAAE,cAAc,GAAG,CAAC;AACzI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
@@ -1,7 +1,7 @@
1
1
  //#region src/utils/errors.ts
2
2
  function addLangChainErrorFields(error, lc_error_code) {
3
3
  error.lc_error_code = lc_error_code;
4
- error.message = `${error.message}\n\nTroubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${lc_error_code}/\n`;
4
+ error.message = `${error.message}\n\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\n`;
5
5
  return error;
6
6
  }
7
7
  function wrapAnthropicClientError(e) {
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,8EAA8E,EAAE,cAAc,GAAG,CAAC;AACnI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
1
+ {"version":3,"file":"errors.js","names":["error: any","lc_error_code: LangChainErrorCodes","e: any"],"sources":["../../src/utils/errors.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-param-reassign */\n\n// Duplicate of core\n// TODO: Remove once we stop supporting 0.2.x core versions\nexport type LangChainErrorCodes =\n | \"INVALID_PROMPT_INPUT\"\n | \"INVALID_TOOL_RESULTS\"\n | \"MESSAGE_COERCION_FAILURE\"\n | \"MODEL_AUTHENTICATION\"\n | \"MODEL_NOT_FOUND\"\n | \"MODEL_RATE_LIMIT\"\n | \"OUTPUT_PARSING_FAILURE\";\n\nexport function addLangChainErrorFields(\n error: any,\n lc_error_code: LangChainErrorCodes\n) {\n (error as any).lc_error_code = lc_error_code;\n error.message = `${error.message}\\n\\nTroubleshooting URL: https://docs.langchain.com/oss/javascript/langchain/errors/${lc_error_code}/\\n`;\n return error;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapAnthropicClientError(e: any) {\n let error;\n if (e.status === 400 && e.message.includes(\"tool\")) {\n error = addLangChainErrorFields(e, \"INVALID_TOOL_RESULTS\");\n } else if (e.status === 401) {\n error = addLangChainErrorFields(e, \"MODEL_AUTHENTICATION\");\n } else if (e.status === 404) {\n error = addLangChainErrorFields(e, \"MODEL_NOT_FOUND\");\n } else if (e.status === 429) {\n error = addLangChainErrorFields(e, \"MODEL_RATE_LIMIT\");\n } else {\n error = e;\n }\n return error;\n}\n"],"mappings":";AAcA,SAAgB,wBACdA,OACAC,eACA;CACC,MAAc,gBAAgB;CAC/B,MAAM,UAAU,GAAG,MAAM,QAAQ,oFAAoF,EAAE,cAAc,GAAG,CAAC;AACzI,QAAO;AACR;AAGD,SAAgB,yBAAyBC,GAAQ;CAC/C,IAAI;AACJ,KAAI,EAAE,WAAW,OAAO,EAAE,QAAQ,SAAS,OAAO,EAChD,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,uBAAuB;UACjD,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,kBAAkB;UAC5C,EAAE,WAAW,KACtB,QAAQ,wBAAwB,GAAG,mBAAmB;MAEtD,QAAQ;AAEV,QAAO;AACR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -14,13 +14,14 @@
14
14
  },
15
15
  "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-anthropic/",
16
16
  "dependencies": {
17
- "@anthropic-ai/sdk": "^0.65.0"
17
+ "@anthropic-ai/sdk": "^0.69.0"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@langchain/core": "^1.0.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@anthropic-ai/vertex-sdk": "^0.11.5",
24
+ "@cfworker/json-schema": "^4.1.1",
24
25
  "@tsconfig/recommended": "^1.0.10",
25
26
  "@vitest/coverage-v8": "^3.2.4",
26
27
  "dotenv": "^17.2.1",
@@ -29,11 +30,12 @@
29
30
  "prettier": "^2.8.3",
30
31
  "rimraf": "^5.0.1",
31
32
  "typescript": "~5.8.3",
33
+ "uuid": "^13.0.0",
32
34
  "vitest": "^3.2.4",
33
35
  "zod": "3.25.76",
34
- "@langchain/core": "1.0.0",
36
+ "@langchain/core": "1.0.5",
35
37
  "@langchain/eslint": "0.1.0",
36
- "@langchain/standard-tests": "0.0.0"
38
+ "@langchain/standard-tests": "0.0.1"
37
39
  },
38
40
  "publishConfig": {
39
41
  "access": "public"
@@ -75,7 +77,8 @@
75
77
  "LICENSE"
76
78
  ],
77
79
  "scripts": {
78
- "build": "pnpm --filter @langchain/build compile @langchain/anthropic",
80
+ "build": "turbo build:compile --filter @langchain/anthropic",
81
+ "build:compile": "pnpm --filter @langchain/build compile @langchain/anthropic",
79
82
  "lint:eslint": "eslint --cache src/",
80
83
  "lint:dpdm": "dpdm --skip-dynamic-imports circular --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
81
84
  "lint": "pnpm lint:eslint && pnpm lint:dpdm",
@@ -88,6 +91,8 @@
88
91
  "test:standard:int": "vitest run --mode standard-int",
89
92
  "test:standard": "pnpm test:standard:unit && pnpm test:standard:int",
90
93
  "format": "prettier --config .prettierrc --write \"src\"",
91
- "format:check": "prettier --config .prettierrc --check \"src\""
94
+ "format:check": "prettier --config .prettierrc --check \"src\"",
95
+ "typegen": "pnpm run typegen:profiles",
96
+ "typegen:profiles": "pnpm --filter @langchain/model-profiles make --config profiles.toml"
92
97
  }
93
98
  }