-
Notifications
You must be signed in to change notification settings - Fork 69
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
Rag/improve file manage #393
base: main
Are you sure you want to change the base?
Conversation
3bca1fe
to
7bdeed6
Compare
@@ -238,7 +304,7 @@ def list_kb_group_files(self, group: str = None, limit: Optional[int] = None, de | |||
upload_status: Union[str, List[str]] = DocListManager.Status.all, | |||
exclude_upload_status: Optional[Union[str, List[str]]] = None): | |||
query = """ | |||
SELECT documents.doc_id, documents.path, documents.status, documents.metadata, | |||
SELECT documents.doc_id, documents.path, documents.status, documents.meta, |
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.
这里为什么要把metadata改名为meta
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.
sqlalchemy 的保留关键字,不能用metadata
lazyllm/tools/rag/utils.py
Outdated
def get_safe_delete_files(self): | ||
ids = [] | ||
with self._db_lock, self._engine.connect() as conn: | ||
stmt = select(KBDocument.doc_id).where(KBDocument.status.in_(["success", "failed"])) |
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.
这里是不是也一次性把waiting的状态更新为failed,然后返回出来
thread 2. add delete_obsolete_files in doclistmaager, it will find status==delting and reference_count==0 file to delete 3. Add reference_count, when adding to kbgroup document reference_count will be updated to +1, when deleting from kbgroup it will be updated to -1 4. Add KBOperationLogs, currently only deleting file operation will be recoreder 5. Modifiy worker thread. when group is default, it will check to delete obsolete file
No description provided.