fix: add length check before summarization in HypaV3
This commit is contained in:
@@ -442,6 +442,7 @@ export async function hypaMemoryV3(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Attempt summarization
|
// Attempt summarization
|
||||||
|
if (toSummarize.length > 0) {
|
||||||
const summarizeResult = await retryableSummarize(toSummarize);
|
const summarizeResult = await retryableSummarize(toSummarize);
|
||||||
|
|
||||||
if (!summarizeResult.success) {
|
if (!summarizeResult.success) {
|
||||||
@@ -458,6 +459,7 @@ export async function hypaMemoryV3(
|
|||||||
chatMemos: new Set(toSummarize.map((chat) => chat.memo)),
|
chatMemos: new Set(toSummarize.map((chat) => chat.memo)),
|
||||||
isImportant: false,
|
isImportant: false,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
currentTokens -= toSummarizeTokens;
|
currentTokens -= toSummarizeTokens;
|
||||||
startIdx = endIdx;
|
startIdx = endIdx;
|
||||||
|
|||||||
Reference in New Issue
Block a user