process_video runs chunks of text through an LLM, and appends the results to a list which it eventually returns. For long videos, it can take a long time to complete. If there’s an error along the way, this can mean none of the results get saved to the database.
Instead of appending to a big list and returning that, it would be preferable to yield results as it gets them.
process_video
runs chunks of text through an LLM, and appends the results to a list which it eventually returns. For long videos, it can take a long time to complete. If there’s an error along the way, this can mean none of the results get saved to the database.Instead of appending to a big list and returning that, it would be preferable to yield results as it gets them.