mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
fix: rate responses
This commit is contained in:
parent
85e9e231ed
commit
299b3d72cf
@ -7,9 +7,8 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let messageId = null;
|
||||
export let show = false;
|
||||
export let message;
|
||||
export let show = false;
|
||||
|
||||
let LIKE_REASONS = [];
|
||||
let DISLIKE_REASONS = [];
|
||||
@ -54,8 +53,10 @@
|
||||
const submitHandler = () => {
|
||||
console.log('submitHandler');
|
||||
|
||||
message.annotation.reason = selectedReason;
|
||||
message.annotation.comment = comment;
|
||||
if (!selectedReason) {
|
||||
toast.error($i18n.t('Please select a reason'));
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch('submit', {
|
||||
reason: selectedReason,
|
||||
@ -69,7 +70,7 @@
|
||||
|
||||
<div
|
||||
class=" my-2.5 rounded-xl px-4 py-3 border dark:border-gray-850"
|
||||
id="message-feedback-{messageId}"
|
||||
id="message-feedback-{message.id}"
|
||||
>
|
||||
<div class="flex justify-between items-center">
|
||||
<div class=" text-sm">{$i18n.t('Tell us more:')}</div>
|
||||
|
@ -1035,11 +1035,17 @@
|
||||
|
||||
{#if message.done && showRateComment}
|
||||
<RateComment
|
||||
messageId={message.id}
|
||||
bind:show={showRateComment}
|
||||
bind:message
|
||||
bind:show={showRateComment}
|
||||
on:submit={(e) => {
|
||||
dispatch('update');
|
||||
dispatch('save', {
|
||||
...message,
|
||||
annotation: {
|
||||
...message.annotation,
|
||||
comment: e.detail.comment,
|
||||
reason: e.detail.reason
|
||||
}
|
||||
});
|
||||
(model?.actions ?? [])
|
||||
.filter((action) => action?.__webui__ ?? false)
|
||||
.forEach((action) => {
|
||||
|
Loading…
Reference in New Issue
Block a user