Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat(message_feedback): add content argument to feedback creation (#12077)

-LAN-5d04638091d0
diff --git a/api/controllers/web/message.py b/api/controllers/web/message.py
index b636e6be620..2afc11f601e 100644
--- a/api/controllers/web/message.py
+++ b/api/controllers/web/message.py
@@ -105,10 +105,17 @@ class MessageFeedbackApi(WebApiResource):
parser = reqparse.RequestParser()
parser.add_argument("rating", type=str, choices=["like", "dislike", None], location="json")
+ parser.add_argument("content", type=str, location="json", default=None)
args = parser.parse_args()
try:
- MessageService.create_feedback(app_model, message_id, end_user, args.get("rating"), args.get("content"))
+ MessageService.create_feedback(
+ app_model=app_model,
+ message_id=message_id,
+ user=end_user,
+ rating=args.get("rating"),
+ content=args.get("content"),
+ )
except services.errors.message.MessageNotExistsError:
raise NotFound("Message Not Exists.")