mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 04:29:10 +08:00
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:
parent
47e244ee9f
commit
6f9cd96ec5
@ -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:
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user