remove 2000 token hard cap for introduction messages - allow full model completion limits
This commit is contained in:
parent
eff2eee69b
commit
88dece974a
2 changed files with 3 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ function calculateAvailableTokens(chatHistory, maxTokens) {
|
|||
buffer = Math.max(1000, Math.floor(inputTokens * 0.5));
|
||||
}
|
||||
|
||||
const availableTokens = Math.max(100, maxTokens - inputTokens - buffer);
|
||||
const availableTokens = Math.max(2000, maxTokens - inputTokens - buffer);
|
||||
console.log(`Token calculation: max=${maxTokens}, input≈${inputTokens}, buffer=${buffer}, available≈${availableTokens}`);
|
||||
return availableTokens;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,8 +151,8 @@ async function* sendMessageWithCustomHistory(messageHistory) {
|
|||
|
||||
// Cap to model's max completion tokens limit
|
||||
const maxCompletionTokens = getSelectedModelMaxCompletionTokens();
|
||||
// For intro generation, try to use at least 500 tokens even if it's a large portion of max completion
|
||||
const finalAvailable = Math.min(calculatedAvailable, maxCompletionTokens, 2000); // Cap at 2000 for reasonable intro length
|
||||
// For intro generation, use the full available tokens up to the model's completion limit
|
||||
const finalAvailable = Math.min(calculatedAvailable, maxCompletionTokens);
|
||||
console.log("UI (intro generation) using tokens:", finalAvailable, "calculated:", calculatedAvailable, "max completion:", maxCompletionTokens, "of model max:", modelMaxTokens);
|
||||
|
||||
const response = await fetch(apiUrl, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue