mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-13 10:09:01 +08:00
add thumb up api (#2092)
### What problem does this PR solve? #2088 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
eb20b60b13
commit
e953f01951
@ -211,10 +211,12 @@ def thumbup():
|
|||||||
conv = conv.to_dict()
|
conv = conv.to_dict()
|
||||||
for i, msg in enumerate(conv["message"]):
|
for i, msg in enumerate(conv["message"]):
|
||||||
if req["message_id"] == msg.get("id", "") and msg.get("role", "") == "assistant":
|
if req["message_id"] == msg.get("id", "") and msg.get("role", "") == "assistant":
|
||||||
if up_down: msg["thumbup"] = True
|
if up_down:
|
||||||
|
msg["thumbup"] = True
|
||||||
|
if "feedback" in msg: del msg["feedback"]
|
||||||
else:
|
else:
|
||||||
msg["thumbup"] = False
|
msg["thumbup"] = False
|
||||||
msg["feedback"] = feedback
|
if feedback: msg["feedback"] = feedback
|
||||||
break
|
break
|
||||||
|
|
||||||
ConversationService.update_by_id(conv["id"], conv)
|
ConversationService.update_by_id(conv["id"], conv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user