mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-09-08 10:14:35 +08:00
### What problem does this PR solve? Enable reading Tag Set tags via API (expose tag_kwd field). The result of the queried list chunks is as shown below: <img width="1422" height="818" alt="image" src="https://github.com/user-attachments/assets/abd1960a-fe34-489e-9d72-525f8e574938" /> ### Type of change - [x] New Feature (non-breaking change which adds functionality) Co-authored-by: heyang.why <heyang.why@alibaba-inc.com>
This commit is contained in:
@@ -155,6 +155,10 @@ async def set():
|
||||
d["question_kwd"] = req["question_kwd"]
|
||||
d["question_tks"] = rag_tokenizer.tokenize("\n".join(req["question_kwd"]))
|
||||
if "tag_kwd" in req:
|
||||
if not isinstance(req["tag_kwd"], list):
|
||||
return get_data_error_result(message="`tag_kwd` should be a list")
|
||||
if not all(isinstance(t, str) for t in req["tag_kwd"]):
|
||||
return get_data_error_result(message="`tag_kwd` must be a list of strings")
|
||||
d["tag_kwd"] = req["tag_kwd"]
|
||||
if "tag_feas" in req:
|
||||
d["tag_feas"] = req["tag_feas"]
|
||||
@@ -317,6 +321,12 @@ async def create():
|
||||
d["question_tks"] = rag_tokenizer.tokenize("\n".join(d["question_kwd"]))
|
||||
d["create_time"] = str(datetime.datetime.now()).replace("T", " ")[:19]
|
||||
d["create_timestamp_flt"] = datetime.datetime.now().timestamp()
|
||||
if "tag_kwd" in req:
|
||||
if not isinstance(req["tag_kwd"], list):
|
||||
return get_data_error_result(message="`tag_kwd` is required to be a list")
|
||||
if not all(isinstance(t, str) for t in req["tag_kwd"]):
|
||||
return get_data_error_result(message="`tag_kwd` must be a list of strings")
|
||||
d["tag_kwd"] = req["tag_kwd"]
|
||||
if "tag_feas" in req:
|
||||
d["tag_feas"] = req["tag_feas"]
|
||||
image_base64 = req.get("image_base64", None)
|
||||
|
||||
Reference in New Issue
Block a user