fix: claude max token

This commit is contained in:
ikechan8370 2025-02-26 22:20:53 +08:00
parent 7bf1c84989
commit 7fcf0c6b58
2 changed files with 3 additions and 2 deletions

View file

@ -151,7 +151,7 @@ export class ClaudeAPIClient extends BaseClient {
let messages = history.map(h => { return { role: h.role, content: h.content } }) let messages = history.map(h => { return { role: h.role, content: h.content } })
body = Object.assign(body, { body = Object.assign(body, {
model: opt.model || this.model || 'claude-3-opus-20240229', model: opt.model || this.model || 'claude-3-opus-20240229',
max_tokens: opt.max_tokens || 1024, max_tokens: opt.max_tokens || 4096,
messages, messages,
stream: false stream: false
}) })

View file

@ -259,7 +259,8 @@ class Core {
stream: false, stream: false,
parentMessageId: conversation.parentMessageId, parentMessageId: conversation.parentMessageId,
conversationId: conversation.conversationId, conversationId: conversation.conversationId,
system: opt.system.claude system: opt.system.claude,
max_tokens: Config.apiMaxToken
} }
let img = await getImg(e) let img = await getImg(e)
if (img && img.length > 0) { if (img && img.length > 0) {