langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Allowing upload a file and immediately run flow

Open mieslep opened this issue 1 year ago • 5 comments

mieslep avatar Dec 03 '24 15:12 mieslep

CodSpeed Performance Report

Merging #5025 will improve performances by 41.22%

Comparing mieslep:phil/run-after-upload (f2d0b10) with main (a142b45)

Summary

⚡ 1 improvements
✅ 14 untouched benchmarks

Benchmarks breakdown

Benchmark main mieslep:phil/run-after-upload Change
test_successful_run_with_input_type_any 278.3 ms 197.1 ms +41.22%

codspeed-hq[bot] avatar Dec 04 '24 11:12 codspeed-hq[bot]

@ogabrielluiz when you get a chance to look at this, this seems like it could be a big improvement. I approved it from my testing but marked it as do not merge because i'd love yours or another set of eyes. Plus wanted to make sure CI/CD didn't pick anything up that I missed.

erichare avatar Dec 06 '24 15:12 erichare

@ogabrielluiz any chance we can get this into 1.1.2? It aligns nicely with a number of other file ingestion improvements, and I'd love to make a little video detailing the enhancements as a whole!

mieslep avatar Dec 12 '24 11:12 mieslep

The problem here is that this seems to fit only the use case in which the file name is the input to the flow.

When we upload a file we normally define where the file will be used by passing file_path in tweaks in the run request.

ogabrielluiz avatar Dec 12 '24 11:12 ogabrielluiz

@ogabrielluiz hmm, but that's not really the case though maybe the doc doesn't make that clear.

    input_request: SimplifiedAPIRequest | None = None,
    file_path_field: str = Query("input_value"),

Allows you to specify the full path to the input_request, and that contains all the tweaks right? So the idea here was that you'd send the tweaks as you would to the run call, but the file_path_field would be injected with the storage service file path location.

mieslep avatar Dec 12 '24 12:12 mieslep