mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: DataSet.update() now refreshes object data (#8058)
### What problem does this PR solve? #8057 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -14,9 +14,13 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
|
||||
class Base:
|
||||
def __init__(self, rag, res_dict):
|
||||
self.rag = rag
|
||||
self._update_from_dict(rag, res_dict)
|
||||
|
||||
def _update_from_dict(self, rag, res_dict):
|
||||
for k, v in res_dict.items():
|
||||
if isinstance(v, dict):
|
||||
self.__dict__[k] = Base(rag, v)
|
||||
@ -27,7 +31,7 @@ class Base:
|
||||
pr = {}
|
||||
for name in dir(self):
|
||||
value = getattr(self, name)
|
||||
if not name.startswith('__') and not callable(value) and name != "rag":
|
||||
if not name.startswith("__") and not callable(value) and name != "rag":
|
||||
if isinstance(value, Base):
|
||||
pr[name] = value.to_json()
|
||||
else:
|
||||
@ -35,7 +39,7 @@ class Base:
|
||||
return pr
|
||||
|
||||
def post(self, path, json=None, stream=False, files=None):
|
||||
res = self.rag.post(path, json, stream=stream,files=files)
|
||||
res = self.rag.post(path, json, stream=stream, files=files)
|
||||
return res
|
||||
|
||||
def get(self, path, params=None):
|
||||
@ -46,8 +50,8 @@ class Base:
|
||||
res = self.rag.delete(path, json)
|
||||
return res
|
||||
|
||||
def put(self,path, json):
|
||||
res = self.rag.put(path,json)
|
||||
def put(self, path, json):
|
||||
res = self.rag.put(path, json)
|
||||
return res
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user