@langchain/anthropic 1.2.2 → 1.2.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @langchain/anthropic
2
2
 
3
+ ## 1.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`0bade90`](https://github.com/langchain-ai/langchainjs/commit/0bade90ed47c7988ed86f1e695a28273c7b3df50), [`6c40d00`](https://github.com/langchain-ai/langchainjs/commit/6c40d00e926f377d249c2919549381522eac8ed1)]:
8
+ - @langchain/core@1.1.4
9
+
3
10
  ## 1.2.2
4
11
 
5
12
  ### Patch Changes
@@ -108,6 +108,7 @@ interface AnthropicInput {
108
108
  * Useful for accessing Anthropic models hosted on other cloud services
109
109
  * such as Google Vertex.
110
110
  */
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
112
  createClient?: (options: ClientOptions) => any;
112
113
  /**
113
114
  * Options for extended thinking.
@@ -662,7 +663,9 @@ declare class ChatAnthropicMessages<CallOptions extends ChatAnthropicCallOptions
662
663
  clientOptions: ClientOptions;
663
664
  thinking: AnthropicThinkingConfigParam;
664
665
  contextManagement?: AnthropicContextManagementConfigParam;
666
+ // Used for non-streaming requests
665
667
  protected batchClient: Anthropic$1;
668
+ // Used for streaming requests
666
669
  protected streamingClient: Anthropic$1;
667
670
  streamUsage: boolean;
668
671
  betas?: AnthropicBeta[];
@@ -764,8 +767,16 @@ declare class ChatAnthropicMessages<CallOptions extends ChatAnthropicCallOptions
764
767
  * ```
765
768
  */
766
769
  get profile(): ModelProfile;
767
- withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
768
- withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
770
+ withStructuredOutput<
771
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
772
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
773
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
774
+ | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
775
+ withStructuredOutput<
776
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
777
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
778
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
779
+ | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
769
780
  raw: BaseMessage;
770
781
  parsed: RunOutput;
771
782
  }>;
@@ -108,6 +108,7 @@ interface AnthropicInput {
108
108
  * Useful for accessing Anthropic models hosted on other cloud services
109
109
  * such as Google Vertex.
110
110
  */
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
112
  createClient?: (options: ClientOptions) => any;
112
113
  /**
113
114
  * Options for extended thinking.
@@ -662,7 +663,9 @@ declare class ChatAnthropicMessages<CallOptions extends ChatAnthropicCallOptions
662
663
  clientOptions: ClientOptions;
663
664
  thinking: AnthropicThinkingConfigParam;
664
665
  contextManagement?: AnthropicContextManagementConfigParam;
666
+ // Used for non-streaming requests
665
667
  protected batchClient: Anthropic$1;
668
+ // Used for streaming requests
666
669
  protected streamingClient: Anthropic$1;
667
670
  streamUsage: boolean;
668
671
  betas?: AnthropicBeta[];
@@ -764,8 +767,16 @@ declare class ChatAnthropicMessages<CallOptions extends ChatAnthropicCallOptions
764
767
  * ```
765
768
  */
766
769
  get profile(): ModelProfile;
767
- withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
768
- withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
770
+ withStructuredOutput<
771
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
772
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
773
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
774
+ | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
775
+ withStructuredOutput<
776
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
777
+ RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput>
778
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
779
+ | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
769
780
  raw: BaseMessage;
770
781
  parsed: RunOutput;
771
782
  }>;
package/dist/types.d.cts CHANGED
@@ -27,11 +27,13 @@ type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolRe
27
27
  type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;
28
28
  type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;
29
29
  type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;
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
  /**
32
33
  * A type representing additional parameters that can be passed to the
33
34
  * Anthropic API.
34
35
  */
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
37
  type Kwargs = Record<string, any>;
36
38
  type AnthropicInvocationParams = Omit<AnthropicMessageCreateParams | AnthropicStreamingMessageCreateParams, "messages"> & Kwargs;
37
39
  //#endregion
package/dist/types.d.ts CHANGED
@@ -27,11 +27,13 @@ type AnthropicWebSearchToolResultBlockParam = Anthropic.Messages.WebSearchToolRe
27
27
  type AnthropicWebSearchResultBlockParam = Anthropic.Messages.WebSearchResultBlockParam;
28
28
  type AnthropicSearchResultBlockParam = Anthropic.SearchResultBlockParam;
29
29
  type AnthropicContainerUploadBlockParam = Anthropic.Beta.BetaContainerUploadBlockParam;
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
  /**
32
33
  * A type representing additional parameters that can be passed to the
33
34
  * Anthropic API.
34
35
  */
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
37
  type Kwargs = Record<string, any>;
36
38
  type AnthropicInvocationParams = Omit<AnthropicMessageCreateParams | AnthropicStreamingMessageCreateParams, "messages"> & Kwargs;
37
39
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -18,7 +18,7 @@
18
18
  "zod": "^3.25.76 || ^4"
19
19
  },
20
20
  "peerDependencies": {
21
- "@langchain/core": "1.1.3"
21
+ "@langchain/core": "1.1.4"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@anthropic-ai/vertex-sdk": "^0.11.5",
@@ -33,9 +33,9 @@
33
33
  "typescript": "~5.8.3",
34
34
  "uuid": "^13.0.0",
35
35
  "vitest": "^3.2.4",
36
- "@langchain/core": "1.1.3",
36
+ "@langchain/core": "1.1.4",
37
37
  "@langchain/eslint": "0.1.1",
38
- "@langchain/standard-tests": "0.0.6"
38
+ "@langchain/standard-tests": "0.0.7"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"