mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-11-11 05:40:52 +08:00
Revert "Refactor: dataset / kb API to RESTFul style" (#13646)
Reverts infiniflow/ragflow#13619
This commit is contained in:
1 parent
fdf2d84ffc
commit
986dcf1cc8
53 files changed
+1207
-1721
No files matched your search
@@ -13,7 +13,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
from typing import Any
|
||||
|
||||
from .base import Base
|
||||
from .document import Document
|
||||
|
||||
@@ -151,23 +151,3 @@ class DataSet(Base):
|
||||
res = res.json()
|
||||
if res.get("code") != 0:
|
||||
raise Exception(res.get("message"))
|
||||
|
||||
def get_auto_metadata(self) -> dict[str, Any]:
|
||||
"""
|
||||
Retrieve auto-metadata configuration for a dataset via SDK.
|
||||
"""
|
||||
res = self.get(f"/datasets/{self.id}/auto_metadata")
|
||||
res = res.json()
|
||||
if res.get("code") == 0:
|
||||
return res["data"]
|
||||
raise Exception(res["message"])
|
||||
|
||||
def update_auto_metadata(self, **config: Any) -> dict[str, Any]:
|
||||
"""
|
||||
Update auto-metadata configuration for a dataset via SDK.
|
||||
"""
|
||||
res = self.put(f"/datasets/{self.id}/auto_metadata", config)
|
||||
res = res.json()
|
||||
if res.get("code") == 0:
|
||||
return res["data"]
|
||||
raise Exception(res["message"])
|
||||
Reference in new issue
Block a user