From d65547dcaa3e79764d30668ff11065287693889c Mon Sep 17 00:00:00 2001 From: municorn Date: Mon, 20 Oct 2025 15:09:59 -0600 Subject: [PATCH] fix(anthropic): remove `top_p` parameter for Claude 4.5 models Fixes #520. --- src/engine/anthropic.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/anthropic.ts b/src/engine/anthropic.ts index 7dbc593..880e400 100644 --- a/src/engine/anthropic.ts +++ b/src/engine/anthropic.ts @@ -37,9 +37,14 @@ export class AnthropicEngine implements AiEngine { system: systemMessage, messages: restMessages, temperature: 0, - top_p: 0.1, max_tokens: this.config.maxTokensOutput }; + + // add top_p for non-4.5 models + if (!params.model.includes('-4-5')) { + params.top_p = 0.1; + } + try { const REQUEST_TOKENS = messages .map((msg) => tokenCount(msg.content as string) + 4)