mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix bugs in API (#3103)
### What problem does this PR solve? Fix bugs in API - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
@ -68,7 +68,7 @@ class Chat(Base):
|
||||
return result_list
|
||||
raise Exception(res["message"])
|
||||
|
||||
def delete_sessions(self,ids):
|
||||
def delete_sessions(self,ids:List[str]=None):
|
||||
res = self.rm(f"/chats/{self.id}/sessions", {"ids": ids})
|
||||
res = res.json()
|
||||
if res.get("code") != 0:
|
||||
|
||||
@ -64,7 +64,7 @@ class RAGFlow:
|
||||
return DataSet(self, res["data"])
|
||||
raise Exception(res["message"])
|
||||
|
||||
def delete_datasets(self, ids: List[str]):
|
||||
def delete_datasets(self, ids: List[str] = None):
|
||||
res = self.delete("/datasets",{"ids": ids})
|
||||
res=res.json()
|
||||
if res.get("code") != 0:
|
||||
@ -135,9 +135,9 @@ class RAGFlow:
|
||||
return Chat(self, res["data"])
|
||||
raise Exception(res["message"])
|
||||
|
||||
def delete_chats(self,ids: List[str] = None,names: List[str] = None ) -> bool:
|
||||
def delete_chats(self,ids: List[str] = None) -> bool:
|
||||
res = self.delete('/chats',
|
||||
{"ids":ids, "names":names})
|
||||
{"ids":ids})
|
||||
res = res.json()
|
||||
if res.get("code") != 0:
|
||||
raise Exception(res["message"])
|
||||
|
||||
Reference in New Issue
Block a user