-
Notifications
You must be signed in to change notification settings - Fork 0
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
Targeted refresh #42
Targeted refresh #42
Conversation
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.
This review addresses several aspects of the code such as improving readability through careful use of control structures, ensuring compatibility with previous Python versions, and also suggests some improvements in documentation. Additional input validation is also recommended to make the code more robust.
Butler is in closed beta. Reply with feedback or to ask Butler to review other parts of the PR. Please give feedback with emoji reacts.
@@ -15,6 +15,7 @@ | |||
from ragdaemon.utils import ( | |||
DEFAULT_CODE_EXTENSIONS, | |||
DEFAULT_COMPLETION_MODEL, | |||
match_refresh, |
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.
Consider using a more idiomatic elif
block instead of multiple separate if
blocks for better readability and performance. Join conditions using elif
where possible.
async def annotate( | ||
self, graph: KnowledgeGraph, db: Database, refresh: bool = False | ||
self, graph: KnowledgeGraph, db: Database, refresh: str | bool = False |
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.
Using Union[str, bool] instead of str | bool might enhance compatibility with older versions of Python. Consider replacing str | bool
with Union[str, bool]
.
async def update(self, refresh=False): | ||
"""Iteratively build the knowledge graph""" | ||
async def update(self, refresh: str | bool = False): | ||
"""Iteratively build the knowledge graph |
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.
Refactoring suggestion: Extract the logic of matching refresh types to a separate method to improve the cohesion and maintainability of this method.
@@ -7,7 +7,7 @@ packages=["ragdaemon"] | |||
|
|||
[project] | |||
name = "ragdaemon" | |||
version = "0.5.0" | |||
version = "0.5.1" |
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.
Update the description of the project in pyproject.toml
to provide more detailed information about what the project does and the specific features it offers.
) | ||
return [] | ||
|
||
async def chunk_document(self, document: str) -> list[dict[str, Any]]: |
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.
The function chunk_document
lacks input validation. Ensure that the document format is correct and not empty before attempting to split and operate on the string to prevent runtime errors.
No description provided.