Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

add thumb up api (#2092)

Kevin Hue953f0195121
diff --git a/api/apps/conversation_app.py b/api/apps/conversation_app.py
index 5fd7c26922..3678c18e6e 100644
--- a/api/apps/conversation_app.py
+++ b/api/apps/conversation_app.py
@@ -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)