2
0
Эх сурвалжийг харах

return when files is empty

Yuki Takei 1 жил өмнө
parent
commit
7b866ef3a3

+ 4 - 0
apps/app/src/server/service/openai/file-upload.ts

@@ -20,6 +20,10 @@ export const fileUpload = async(pages: PageToUpload[]): Promise<void> => {
       return file;
     });
 
+  if (filesPromise.length === 0) {
+    return;
+  }
+
   const files = await Promise.all(filesPromise);
 
   await openaiClient.beta.vectorStores.fileBatches.uploadAndPoll(vectorStoreId, { files });