deepset-ai / haystack

AI orchestration framework to build customizable, production-ready LLM applications. Connect components (models, vector DBs, file converters) to pipelines or agents that can interact with your data. With advanced retrieval methods, it's best suited for building RAG, question answering, semantic search or conversational agent chatbots.
https://haystack.deepset.ai
Apache License 2.0
17.72k stars 1.92k forks source link

feat: Extend core component machinery to support an async run method (experimental) #8279

Closed shadeMe closed 2 months ago

shadeMe commented 2 months ago

Related Issues

Proposed Changes:

This PR extends the core component machinery to add support for an async def async_run(self) method in components. The async_run method is optional. If it's present, it should have the same parameters (and output types) as the run method and must be implemented as a coroutine (awaitable).

How did you test it?

Unit tests

Checklist

coveralls commented 2 months ago

Pull Request Test Coverage Report for Build 10575946976

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Files with Coverage Reduction New Missed Lines %
components/preprocessors/document_splitter.py 1 98.96%
core/component/component.py 2 97.93%
core/component/sockets.py 5 84.62%
components/retrievers/sentence_window_retriever.py 10 76.09%
core/pipeline/pipeline.py 13 79.55%
<!-- Total: 31 -->
Totals Coverage Status
Change from base Build 10522538514: -0.009%
Covered Lines: 7005
Relevant Lines: 7766

💛 - Coveralls