From 7fcf0c6b5849229ac2e56b62f90f8702c04fe07e Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Wed, 26 Feb 2025 22:20:53 +0800 Subject: [PATCH] fix: claude max token --- client/ClaudeAPIClient.js | 2 +- model/core.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/ClaudeAPIClient.js b/client/ClaudeAPIClient.js index 15072b9..7a30ad8 100644 --- a/client/ClaudeAPIClient.js +++ b/client/ClaudeAPIClient.js @@ -151,7 +151,7 @@ export class ClaudeAPIClient extends BaseClient { let messages = history.map(h => { return { role: h.role, content: h.content } }) body = Object.assign(body, { model: opt.model || this.model || 'claude-3-opus-20240229', - max_tokens: opt.max_tokens || 1024, + max_tokens: opt.max_tokens || 4096, messages, stream: false }) diff --git a/model/core.js b/model/core.js index eb1415b..21c8b35 100644 --- a/model/core.js +++ b/model/core.js @@ -259,7 +259,8 @@ class Core { stream: false, parentMessageId: conversation.parentMessageId, conversationId: conversation.conversationId, - system: opt.system.claude + system: opt.system.claude, + max_tokens: Config.apiMaxToken } let img = await getImg(e) if (img && img.length > 0) {