diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index e0852bb42..99b6ed742 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -196,6 +196,31 @@ const postChatMessage: (chat_id: string, message: string) => Promise = (cha return postStream(`/api/${prefix}/chat_message/${chat_id}`, { message }) } +/** + * 点赞、点踩 + * @param 参数 + * application_id : string; chat_id : string; chat_record_id : string + * { + "vote_status": "string", // -1 0 1 + } + */ +const putChatVote: ( + application_id: string, + chat_id: string, + chat_record_id: string, + vote_status: string, + loading?: Ref +) => Promise = (application_id, chat_id, chat_record_id, vote_status, loading) => { + return put( + `${prefix}/${application_id}/chat/${chat_id}/chat_record/${chat_record_id}/vote`, + { + vote_status + }, + undefined, + loading + ) +} + export default { getAllAppilcation, getApplication, @@ -210,5 +235,6 @@ export default { getAPIKey, getAccessToken, postAppAuthentication, - getProfile + getProfile, + putChatVote } diff --git a/ui/src/api/type/application.ts b/ui/src/api/type/application.ts index 65605fbf5..713964d51 100644 --- a/ui/src/api/type/application.ts +++ b/ui/src/api/type/application.ts @@ -22,6 +22,8 @@ interface chatType { * 是否暂停 */ is_stop?: boolean + record_id: string + vote_status: string } export class ChatRecordManage { diff --git a/ui/src/components/ai-dialog/OperationButton.vue b/ui/src/components/ai-dialog/OperationButton.vue index 0690529d7..ed661187e 100644 --- a/ui/src/components/ai-dialog/OperationButton.vue +++ b/ui/src/components/ai-dialog/OperationButton.vue @@ -7,45 +7,85 @@ - + - - + + - - + + - - - + + + - - + + diff --git a/ui/src/components/ai-dialog/index.vue b/ui/src/components/ai-dialog/index.vue index dd186c63e..89eec2150 100644 --- a/ui/src/components/ai-dialog/index.vue +++ b/ui/src/components/ai-dialog/index.vue @@ -78,9 +78,9 @@ > - +
+ +
@@ -109,10 +109,16 @@