We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a310352 commit 831c1f6Copy full SHA for 831c1f6
src/tools/embeddings.ts
@@ -26,7 +26,7 @@ export async function getEmbeddings(
26
}
27
28
// Handle empty input case
29
- if (texts.length === 0) {
+ if (texts.length === 0 || texts.every(text => !text || (typeof text === 'object' && !Object.values(text)?.[0]))) {
30
return { embeddings: [], tokens: 0 };
31
32
0 commit comments