@langchain/anthropic 0.3.26 → 0.3.27

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.
@@ -695,7 +695,9 @@ class ChatAnthropicMessages extends chat_models_1.BaseChatModel {
695
695
  if (this.topK !== -1) {
696
696
  throw new Error("topK is not supported when thinking is enabled");
697
697
  }
698
- if (this.topP !== -1) {
698
+ if (this.model.includes("opus-4-1")
699
+ ? this.topP !== undefined
700
+ : this.topP !== -1) {
699
701
  throw new Error("topP is not supported when thinking is enabled");
700
702
  }
701
703
  if (this.temperature !== 1) {
@@ -692,7 +692,9 @@ export class ChatAnthropicMessages extends BaseChatModel {
692
692
  if (this.topK !== -1) {
693
693
  throw new Error("topK is not supported when thinking is enabled");
694
694
  }
695
- if (this.topP !== -1) {
695
+ if (this.model.includes("opus-4-1")
696
+ ? this.topP !== undefined
697
+ : this.topP !== -1) {
696
698
  throw new Error("topP is not supported when thinking is enabled");
697
699
  }
698
700
  if (this.temperature !== 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/anthropic",
3
- "version": "0.3.26",
3
+ "version": "0.3.27",
4
4
  "description": "Anthropic integrations for LangChain.js",
5
5
  "type": "module",
6
6
  "engines": {