Skip to content

Add run_async method to SentenceWindowRetriever #9870

@fkdosilovic

Description

@fkdosilovic

Is your feature request related to a problem? Please describe.
I'm trying to minimize the number of components in my RAG retrieval pipeline that rely on running in the threadpool to be async compatible. It looks like that the SentenceWindowRetriever could easily (maybe I'm missing something) support run_async method by relying on the document_store.filter_documents_async method.

Describe the solution you'd like
Add the run_async to SentenceWindowRetriever that relies on document_store.filter_documents_async method.

Describe alternatives you've considered
The most general solution is already implemented in the library itself - run the component in a threadpool. I don't know any other good solutions.

Additional context

  1. I saw the internal implementation of SentenceWindowRetriever.run method and I realize that most processing/work is being done inside the component itself, but that doesn't mean that the component should not be fully async friendly.
  2. I did not find any discussion in the previous PRs related to SentenceWindowRetriever that comment/discuss why the run_async is not implemented.
  3. I can work on the PR.

Metadata

Metadata

Assignees

Labels

Contributions wanted!Looking for external contributionsP2Medium priority, add to the next sprint if no P1 available

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions