-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
create and update dataset #2110
Conversation
@@ -0,0 +1,72 @@ | |||
from flask import request |
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.
from flask import request | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
from flask import request |
api/apps/sdk/dataset.py
Outdated
@manager.route('/save', methods=['POST']) | ||
def save(): | ||
req = request.json | ||
try: |
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.
remove try...except
api/apps/sdk/dataset.py
Outdated
else: | ||
if req["tenant_id"] != tenant_id or req["embd_id"] != t.embd_id : | ||
return get_data_error_result( | ||
retmsg="Can't change tenant_id or embedding_model") |
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.
if chunk_num > 0, parser method is not changable.
count of chunk and document are constant.
sdk/python/ragflow/ragflow.py
Outdated
""" | ||
res_create = self.post("/create", {"name": dataset_name}) | ||
def create_dataset(self, name:str,avatar:str="",description:str="",language:str="English",permission:str="me", | ||
document_count:int=0,chunk_count:int=0,parse_method:str="0", |
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.
document_count:int=0,chunk_count:int=0,parse_method:str="0", | |
document_count:int=0,chunk_count:int=0,parse_method:str="naive", |
sdk/python/ragflow/ragflow.py
Outdated
return res.json()["retmsg"] | ||
|
||
|
||
''' |
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.
remove commented code
sdk/python/ragflow/ragflow.py
Outdated
self.dataset_url = f"{self.api_url}/kb" | ||
self.authorization_header = {"Authorization": "{}".format(self.user_key)} | ||
self.api_url = f"{base_url}/api/{version}" | ||
self.dataset_url = f"{self.api_url}/dataset" |
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.
self.dataset_url = f"{self.api_url}/dataset" |
### What problem does this PR solve? Added the ability to create and update dataset for SDK ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: root <root@xwg> Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
What problem does this PR solve?
Added the ability to create and update dataset for SDK
Type of change