Fix: ingestion pipeline (#13012)

### What problem does this PR solve?

Fix ingestion pipeline
Only 1 file is acceptable for ingestion pipeline.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Magicbook1108
2026-02-05 15:55:41 +08:00
committed by GitHub
parent 89fdb1d498
commit 75b2d482e2
3 changed files with 8 additions and 4 deletions

View File

@ -42,7 +42,7 @@ class File(ProcessBase):
#self.set_output("blob", STORAGE_IMPL.get(b, n))
self.set_output("name", doc.name)
else:
file = kwargs.get("file")
file = kwargs.get("file")[0]
self.set_output("name", file["name"])
self.set_output("file", file)
#self.set_output("blob", FileService.get_blob(file["created_by"], file["id"]))

View File

@ -21,11 +21,13 @@ import { toast } from 'sonner';
type FileUploadDirectUploadProps = {
value: Record<string, any> | Record<string, any>[];
onChange(value: Record<string, any>[]): void;
maxFiles?: number;
};
export function FileUploadDirectUpload({
value,
onChange,
maxFiles,
}: FileUploadDirectUploadProps) {
const [files, setFiles] = React.useState<File[]>([]);
const uploadedFilesRef = React.useRef<Record<string, any>[]>(
@ -99,9 +101,10 @@ export function FileUploadDirectUpload({
onValueChange={handleFilesChange}
onUpload={onUpload}
onFileReject={onFileReject}
maxFiles={5}
// TODO DEFALUT to 5 / 1 for params
maxFiles={(maxFiles ?? 5) as number}
className="w-full"
multiple={true}
multiple={!maxFiles || !!(maxFiles && maxFiles > 1)}
>
<FileUploadDropzone>
<div className="flex flex-col items-center gap-1 text-center">
@ -110,7 +113,7 @@ export function FileUploadDirectUpload({
</div>
<p className="font-medium text-sm">Drag & drop files here</p>
<p className="text-muted-foreground text-xs">
Or click to browse (max 5 files)
Or click to browse (max {(maxFiles ?? 5) as number} files)
</p>
</div>
<FileUploadTrigger asChild>

View File

@ -37,6 +37,7 @@ export function UploaderForm({ ok, loading }: UploaderFormProps) {
<FileUploadDirectUpload
value={field.value}
onChange={field.onChange}
maxFiles={1}
></FileUploadDirectUpload>
);
}}