Fix: dataset_ids parameter (#5864)

### What problem does this PR solve?

Fixed  #5839
This PR fix  error code 102, stating dataset_ids is required.

curl --request POST \
     --url http://{address}/api/v1/chats \
     --header 'Content-Type: application/json' \
     --header 'Authorization: Bearer <YOUR_API_KEY>' \
     --data '{
         "name": "test_chat"
     }'
     
     this is not getting datasetids , fix for it. 

file location : sdk\python\ragflow_sdk\ragflow.py

added : "dataset_ids": dataset_list if dataset_list else [],



### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Raghav <2020csb1115@iitrpr.ac.in>
This commit is contained in:
Raghav Patidar 2025-03-11 07:14:06 +05:30 committed by GitHub
parent 47e244ee9f
commit 6f9cd96ec5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ from api.utils.api_utils import get_result
@token_required
def create(tenant_id):
req = request.json
ids = [i for i in req.get("dataset_ids", []) if i]
ids = [i for i in req.get("dataset_ids", []) if i]
for kb_id in ids:
kbs = KnowledgebaseService.accessible(kb_id=kb_id, user_id=tenant_id)
if not kbs:

View File

@ -129,7 +129,7 @@ class RAGFlow:
temp_dict = {"name": name,
"avatar": avatar,
"dataset_ids": dataset_list,
"dataset_ids": dataset_list if dataset_list else [],
"llm": llm.to_json(),
"prompt": prompt.to_json()}
res = self.post("/chats", temp_dict)