@langchain/anthropic 0.3.31 → 0.3.32
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/dist/chat_models.cjs +6 -3
- package/dist/chat_models.d.ts +0 -2
- package/dist/chat_models.js +6 -3
- package/package.json +1 -1
package/dist/chat_models.cjs
CHANGED
|
@@ -615,8 +615,9 @@ class ChatAnthropicMessages extends chat_models_1.BaseChatModel {
|
|
|
615
615
|
this.modelName = fields?.model ?? fields?.modelName ?? this.model;
|
|
616
616
|
this.model = this.modelName;
|
|
617
617
|
this.invocationKwargs = fields?.invocationKwargs ?? {};
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
if (this.model.includes("opus-4-1") ||
|
|
619
|
+
this.model.includes("sonnet-4-5") ||
|
|
620
|
+
this.model.includes("haiku-4-5")) {
|
|
620
621
|
this.topP = fields?.topP === null ? undefined : fields?.topP;
|
|
621
622
|
}
|
|
622
623
|
else {
|
|
@@ -704,7 +705,9 @@ class ChatAnthropicMessages extends chat_models_1.BaseChatModel {
|
|
|
704
705
|
if (this.topK !== -1) {
|
|
705
706
|
throw new Error("topK is not supported when thinking is enabled");
|
|
706
707
|
}
|
|
707
|
-
if (this.model.includes("opus-4-1") ||
|
|
708
|
+
if (this.model.includes("opus-4-1") ||
|
|
709
|
+
this.model.includes("sonnet-4-5") ||
|
|
710
|
+
this.model.includes("haiku-4-5")
|
|
708
711
|
? this.topP !== undefined
|
|
709
712
|
: this.topP !== -1) {
|
|
710
713
|
throw new Error("topP is not supported when thinking is enabled");
|
package/dist/chat_models.d.ts
CHANGED
|
@@ -52,8 +52,6 @@ export interface AnthropicInput {
|
|
|
52
52
|
*
|
|
53
53
|
* To not set this field, pass `null`. If `undefined` is passed,
|
|
54
54
|
* the default (-1) will be used.
|
|
55
|
-
*
|
|
56
|
-
* For Opus 4.1 and Sonnet 4.5, this defaults to `null`.
|
|
57
55
|
*/
|
|
58
56
|
topP?: number | null;
|
|
59
57
|
/** A maximum number of tokens to generate before stopping. */
|
package/dist/chat_models.js
CHANGED
|
@@ -612,8 +612,9 @@ export class ChatAnthropicMessages extends BaseChatModel {
|
|
|
612
612
|
this.modelName = fields?.model ?? fields?.modelName ?? this.model;
|
|
613
613
|
this.model = this.modelName;
|
|
614
614
|
this.invocationKwargs = fields?.invocationKwargs ?? {};
|
|
615
|
-
|
|
616
|
-
|
|
615
|
+
if (this.model.includes("opus-4-1") ||
|
|
616
|
+
this.model.includes("sonnet-4-5") ||
|
|
617
|
+
this.model.includes("haiku-4-5")) {
|
|
617
618
|
this.topP = fields?.topP === null ? undefined : fields?.topP;
|
|
618
619
|
}
|
|
619
620
|
else {
|
|
@@ -701,7 +702,9 @@ export class ChatAnthropicMessages extends BaseChatModel {
|
|
|
701
702
|
if (this.topK !== -1) {
|
|
702
703
|
throw new Error("topK is not supported when thinking is enabled");
|
|
703
704
|
}
|
|
704
|
-
if (this.model.includes("opus-4-1") ||
|
|
705
|
+
if (this.model.includes("opus-4-1") ||
|
|
706
|
+
this.model.includes("sonnet-4-5") ||
|
|
707
|
+
this.model.includes("haiku-4-5")
|
|
705
708
|
? this.topP !== undefined
|
|
706
709
|
: this.topP !== -1) {
|
|
707
710
|
throw new Error("topP is not supported when thinking is enabled");
|