-
Notifications
You must be signed in to change notification settings - Fork 204
feat: add async support for CohereDocumentEmbedder #1876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add async support for CohereDocumentEmbedder #1876
Conversation
dd06724 to
49399c0
Compare
49399c0 to
9077fbc
Compare
Have raised PRs for Ollama integration as well. Both document and text embedder in case that's in eye for the next release. |
a8e1575 to
1caee03
Compare
vblagoje
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @srini047 left some initial feedback - minor issues, but worth addressing imho
integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py
Show resolved
Hide resolved
integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py
Show resolved
Hide resolved
fc2900b to
4abb192
Compare
vblagoje
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for this contribution @srini047
vblagoje
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srini047 a small favour, while we are at it:
- initialize AsyncClient in init, don't use asserts raise meaningful errors (see other components)
- in both run methods use async client
- in run sync use asyncio to bridge
- in run async use current approach
- Flag with log warn use_async_client param as deprecated and ignore it
This is a legacy code before we have async method and we might as well remove it now 👏
@vblagoje |
|
Yes, very good point let's just resolve the test failures now and integrate this one |
e68d8d7 to
73e94ac
Compare
anakin87
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related Issues
CohereDocumentEmbedder#1507Proposed Changes:
Added
run_asyncconversion forCohereDocumentEmbedderHow did you test it?
Added a separate test case for testing asyc feature.
Notes for the reviewer
To be merged after #1873 since dependencies are present here.
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.