Skip to content

Commit

Permalink
add thumb up api (infiniflow#2092)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#2088

### Type of change
 
- [x] New Feature (non-breaking change which adds functionality)
  • Loading branch information
KevinHuSh authored Aug 26, 2024
1 parent 704ff5b commit d963eb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/apps/conversation_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,12 @@ def thumbup():
conv = conv.to_dict()
for i, msg in enumerate(conv["message"]):
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:
msg["thumbup"] = False
msg["feedback"] = feedback
if feedback: msg["feedback"] = feedback
break

ConversationService.update_by_id(conv["id"], conv)
Expand Down

0 comments on commit d963eb3

Please sign in to comment.