You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -154,13 +157,18 @@ export async function vectorCreateIndex(
154
157
checkCancelled(cancellationToken);
155
158
156
159
if(!options.vectorSize){
160
+
dbg(`sniffing vector size for %s`,indexName);
157
161
constsniff=awaitcachedEmbedder(
162
+
158
163
`Lorem ipsum dolor sit amet, consectetur adipiscing elit
159
164
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.`,
160
165
configuration,
161
166
options,
162
167
);
163
-
options.vectorSize=sniff.data[0].length;
168
+
constvectorSize=sniff.data?.[0]?.length;
169
+
dbg(`sniffed vector size: %o`,sniff.data);
170
+
if(isNaN(vectorSize))thrownewError("embeddings: unable to determine vector size");
0 commit comments