mirror of https://github.com/buster-so/buster.git
lint fixes
This commit is contained in:
parent
42d1da5389
commit
482564528a
|
@ -73,20 +73,22 @@ function getMostRecentRawLlmMessages(
|
||||||
// We iterate backwards to find the most recent valid message
|
// We iterate backwards to find the most recent valid message
|
||||||
for (let i = chatMessages.length - 1; i >= 0; i--) {
|
for (let i = chatMessages.length - 1; i >= 0; i--) {
|
||||||
const message = chatMessages[i];
|
const message = chatMessages[i];
|
||||||
|
|
||||||
// Skip if message is not completed
|
// Skip if message is not completed
|
||||||
if (!message?.isCompleted) {
|
if (!message?.isCompleted) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip if rawLlmMessages is empty, null, or default empty object
|
// Skip if rawLlmMessages is empty, null, or default empty object
|
||||||
const rawMessages = message.rawLlmMessages;
|
const rawMessages = message.rawLlmMessages;
|
||||||
if (!rawMessages ||
|
if (
|
||||||
(typeof rawMessages === 'object' && Object.keys(rawMessages).length === 0) ||
|
!rawMessages ||
|
||||||
rawMessages === '{}') {
|
(typeof rawMessages === 'object' && Object.keys(rawMessages).length === 0) ||
|
||||||
|
rawMessages === '{}'
|
||||||
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if it's a valid array
|
// Check if it's a valid array
|
||||||
if (Array.isArray(rawMessages) && rawMessages.length > 0) {
|
if (Array.isArray(rawMessages) && rawMessages.length > 0) {
|
||||||
return rawMessages as CoreMessage[];
|
return rawMessages as CoreMessage[];
|
||||||
|
|
Loading…
Reference in New Issue