-
Notifications
You must be signed in to change notification settings - Fork 966
Transition to new retrievers, update searches #585
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
Merged
soobrosa
merged 7 commits into
dev
from
feature/cog-1403-transition-to-new-retrievers-update-searches
Feb 27, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
30927d7
First render.
soobrosa b02231d
Small fixes.
soobrosa 2d90221
coderabbit don't be smart
soobrosa f482593
Fixing BaseRetriever refs.
soobrosa 158a68d
Catch an orphan.
soobrosa 931717e
Lean inits.
soobrosa 9537221
Merge branch 'dev' into feature/cog-1403-transition-to-new-retrievers…
soobrosa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| from cognee.modules.retrieval.utils.code_graph_retrieval import code_graph_retrieval | ||
| from cognee.modules.retrieval.code_retriever import CodeRetriever |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
221 changes: 0 additions & 221 deletions
221
cognee/modules/retrieval/utils/run_search_comparisons.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Add await to async method call in lambda
The
as_searchmethod returns a lambda that callsget_completionwithout awaiting it, butget_completionis an async method as defined in lines 13-16. This will return a coroutine object instead of the actual completion result.@classmethod def as_search(cls) -> Callable: """Creates a search function from the retriever class.""" - return lambda query: cls().get_completion(query) + return lambda query: await cls().get_completion(query)Additionally, since this returns an awaitable function, you should update the return type annotation to reflect this:
This will require adding
Awaitableto your imports.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.
I think I agree with the rabbit here, but I tested and both seem to work. Conceptually, it does seem like we should await for the
.get_completionsomewhere.I would probably go with the implementation that defines an inner function, for neatness, but up to you:
@hajdul88 , please chime in as you are the one with the most experience with this.
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.
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.
I am not sure we have to await it here as it is a lambda definition no?