fix: anthropic temperature parameter not respecting value 0 (#2190)

Co-authored-by: Marcus Schiesser <marcus.schiesser@googlemail.com>
This commit is contained in:
Neha Prasad
2025-09-10 09:15:12 +05:30
committed by GitHub
parent ed37c645af
commit 5d5cd44276
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@llamaindex/anthropic": patch
---
fix: anthropic temperature parameter not respecting value 0
+1 -1
View File
@@ -179,7 +179,7 @@ export class Anthropic extends ToolCallLLM<
constructor(init?: Partial<Anthropic>) {
super();
this.model = init?.model ?? "claude-3-opus";
this.temperature = init?.temperature ?? 1; // default in anthropic is 1
this.temperature = init?.temperature != null ? init.temperature : 1; // default in anthropic is 1
this.topP = init?.topP;
this.maxTokens = init?.maxTokens ?? undefined;