mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 15:39:06 +08:00
fix empty embeddings issue
This commit is contained in:
@@ -26,7 +26,7 @@ export async function getEmbeddings(
|
||||
}
|
||||
|
||||
// Handle empty input case
|
||||
if (texts.length === 0) {
|
||||
if (texts.length === 0 || texts.every(text => !text || (typeof text === 'object' && !Object.values(text)?.[0]))) {
|
||||
return { embeddings: [], tokens: 0 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user