Skip to content

Commit 831c1f6

Browse files
committed
fix empty embeddings issue
1 parent a310352 commit 831c1f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/embeddings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function getEmbeddings(
2626
}
2727

2828
// Handle empty input case
29-
if (texts.length === 0) {
29+
if (texts.length === 0 || texts.every(text => !text || (typeof text === 'object' && !Object.values(text)?.[0]))) {
3030
return { embeddings: [], tokens: 0 };
3131
}
3232

0 commit comments

Comments
 (0)