mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
fix bugs in test (#3196)
### What problem does this PR solve? fix bugs in test ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --------- Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
@ -48,8 +48,8 @@ class DataSet(Base):
|
||||
return doc_list
|
||||
raise Exception(res.get("message"))
|
||||
|
||||
def list_documents(self, id: str = None, keywords: str = None, offset: int =1, limit: int = 1024, orderby: str = "create_time", desc: bool = True):
|
||||
res = self.get(f"/datasets/{self.id}/documents",params={"id": id,"keywords": keywords,"offset": offset,"limit": limit,"orderby": orderby,"desc": desc})
|
||||
def list_documents(self, id: str = None, keywords: str = None, page: int =1, page_size: int = 1024, orderby: str = "create_time", desc: bool = True):
|
||||
res = self.get(f"/datasets/{self.id}/documents",params={"id": id,"keywords": keywords,"page": page,"page_size": page_size,"orderby": orderby,"desc": desc})
|
||||
res = res.json()
|
||||
documents = []
|
||||
if res.get("code") == 0:
|
||||
|
||||
@ -50,8 +50,8 @@ class Document(Base):
|
||||
return res.content
|
||||
|
||||
|
||||
def list_chunks(self,offset=0, limit=30, keywords="", id:str=None):
|
||||
data={"document_id": self.id,"keywords": keywords,"offset":offset,"limit":limit,"id":id}
|
||||
def list_chunks(self,page=1, page_size=30, keywords="", id:str=None):
|
||||
data={"keywords": keywords,"page":page,"page_size":page_size,"id":id}
|
||||
res = self.get(f'/datasets/{self.dataset_id}/documents/{self.id}/chunks', data)
|
||||
res = res.json()
|
||||
if res.get("code") == 0:
|
||||
@ -71,7 +71,7 @@ class Document(Base):
|
||||
raise Exception(res.get("message"))
|
||||
|
||||
def delete_chunks(self,ids:List[str] = None):
|
||||
res = self.rm(f"datasets/{self.dataset_id}/documents/{self.id}/chunks",{"ids":ids})
|
||||
res = self.rm(f"/datasets/{self.dataset_id}/documents/{self.id}/chunks",{"chunk_ids":ids})
|
||||
res = res.json()
|
||||
if res.get("code")!=0:
|
||||
raise Exception(res.get("message"))
|
||||
Reference in New Issue
Block a user