mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-26 06:28:56 +08:00
fix empty embeddings issue
This commit is contained in:
parent
a310352d82
commit
831c1f66e3
@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user