Yuki Takei 1 год назад
Родитель
Сommit
7b866ef3a3
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      apps/app/src/server/service/openai/file-upload.ts

+ 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;
       return file;
     });
     });
 
 
+  if (filesPromise.length === 0) {
+    return;
+  }
+
   const files = await Promise.all(filesPromise);
   const files = await Promise.all(filesPromise);
 
 
   await openaiClient.beta.vectorStores.fileBatches.uploadAndPoll(vectorStoreId, { files });
   await openaiClient.beta.vectorStores.fileBatches.uploadAndPoll(vectorStoreId, { files });