mirror of
https://github.com/langgenius/dify.git
synced 2026-11-13 06:41:07 +08:00
refactor(api): unify message feedback across app entrypoints (#43748)
This commit is contained in:
54 files changed
+2377
-1455
No files matched your search
Generated
+4
-1
@@ -1192,6 +1192,7 @@ Create or update Agent App message feedback
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Feedback updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)<br> |
|
||||
| 400 | Bad Request | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 404 | Agent or message not found | **application/json**: [AgentNotFoundError](#agentnotfounderror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| default | Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
|
||||
@@ -3219,6 +3220,8 @@ Create or update message feedback (like/dislike)
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Feedback updated successfully | **application/json**: [SimpleResultResponse](#simpleresultresponse)<br> |
|
||||
| 400 | Bad Request | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Insufficient permissions | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 404 | Message not found | **application/json**: [AppNotFoundError](#appnotfounderror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| default | Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
|
||||
@@ -8011,7 +8014,7 @@ Request body:
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Feedback submitted successfully | **application/json**: [ResultResponse](#resultresponse)<br> |
|
||||
| 400 | Bad Request | **application/json**: [MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 400 | Bad Request | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden | **application/json**: [AccessDeniedError](#accessdeniederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 404 | Not Found | **application/json**: [InstalledAppNotFoundError](#installedappnotfounderror)<br>[MessageNotFoundError](#messagenotfounderror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 503 | Service Unavailable | **application/json**: [WebAppAccessUnavailableError](#webappaccessunavailableerror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
|
||||
Generated
+12
-3
@@ -1745,8 +1745,9 @@ Retrieve a paginated list of all feedback submitted for messages in this applica
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | A list of application feedbacks. | **application/json**: [AppFeedbackListResponse](#appfeedbacklistresponse)<br> |
|
||||
| 400 | `app_unavailable`: App is no longer available. | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 401 | Unauthorized - invalid API token | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden - token scope, app, dataset, or workspace access denied | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden - token scope, app, dataset, or workspace access denied | **application/json**: [AppAbnormalStatusError](#appabnormalstatuserror)<br>[AppApiDisabledError](#appapidisablederror)<br>[AppNotFoundError](#appnotfounderror)<br>[WorkspaceArchivedError](#workspacearchivederror)<br>[WorkspaceNotFoundError](#workspacenotfounderror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| default | Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
|
||||
### [POST] /messages/{message_id}/feedbacks
|
||||
@@ -1771,9 +1772,9 @@ Submit feedback for a message. End users can rate messages as `like` or `dislike
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Feedback submitted successfully | **application/json**: [ResultResponse](#resultresponse)<br> |
|
||||
| 400 | Bad request - invalid feedback payload | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 400 | `message_feedback_rating_required`: Cannot revoke feedback that does not exist. `app_unavailable`: App is no longer available. | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 401 | Unauthorized - invalid API token | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden - token scope, app, dataset, or workspace access denied | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden - token scope, app, dataset, or workspace access denied | **application/json**: [AppAbnormalStatusError](#appabnormalstatuserror)<br>[AppApiDisabledError](#appapidisablederror)<br>[AppNotFoundError](#appnotfounderror)<br>[WorkspaceArchivedError](#workspacearchivederror)<br>[WorkspaceNotFoundError](#workspacenotfounderror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 404 | `not_found` : Message does not exist. | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| default | Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
|
||||
@@ -7064,6 +7065,14 @@ Agent Knowledge Base is unavailable.
|
||||
| rating | string, <br>**Available values:** "dislike", "like" | Feedback rating. Set to `null` to revoke previously submitted feedback. | No |
|
||||
| user | string | End-user identifier, defined by your app and unique within it. Identifies the end user for this request. See [End User Identity](/api-reference/guides/end-user-identity) for endpoint-specific access rules. | Yes |
|
||||
|
||||
#### MessageFeedbackRatingRequiredError
|
||||
|
||||
A rating is required when there is no existing feedback to remove.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| MessageFeedbackRatingRequiredError | | A rating is required when there is no existing feedback to remove. | |
|
||||
|
||||
#### MessageFile
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|
||||
Generated
+10
-1
@@ -549,8 +549,9 @@ Submit feedback (like/dislike) for a specific message.
|
||||
| Code | Description | Schema |
|
||||
| ---- | ----------- | ------ |
|
||||
| 200 | Feedback submitted successfully | **application/json**: [ResultResponse](#resultresponse)<br> |
|
||||
| 400 | Bad Request | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 400 | `message_feedback_rating_required`: Cannot revoke feedback that does not exist. `app_unavailable`: App is no longer available. | **application/json**: [AppUnavailableError](#appunavailableerror)<br>[MessageFeedbackRatingRequiredError](#messagefeedbackratingrequirederror)<br>[ErrorResponse](#errorresponse)<br> |
|
||||
| 401 | Unauthorized | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 403 | Forbidden | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 404 | Message Not Found | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| 500 | Internal Server Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
| default | Error | **application/json**: [ErrorResponse](#errorresponse)<br> |
|
||||
@@ -1586,6 +1587,14 @@ The upload token is malformed.
|
||||
| content | string | Optional text feedback providing additional detail. | No |
|
||||
| rating | string, <br>**Available values:** "dislike", "like" | Feedback rating. Set to `null` to revoke previously submitted feedback. | No |
|
||||
|
||||
#### MessageFeedbackRatingRequiredError
|
||||
|
||||
A rating is required when there is no existing feedback to remove.
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
| ---- | ---- | ----------- | -------- |
|
||||
| MessageFeedbackRatingRequiredError | | A rating is required when there is no existing feedback to remove. | |
|
||||
|
||||
#### MessageFile
|
||||
|
||||
| Name | Type | Description | Required |
|
||||
|
||||
Reference in new issue
Block a user