diff --git a/src/lib/components/chat/Messages/RateComment.svelte b/src/lib/components/chat/Messages/RateComment.svelte
index 2cccf20d8..39ae17318 100644
--- a/src/lib/components/chat/Messages/RateComment.svelte
+++ b/src/lib/components/chat/Messages/RateComment.svelte
@@ -38,6 +38,7 @@
let selectedReason = null;
let comment = '';
+ let detailedRating = null;
let selectedModel = null;
$: if (message?.annotation?.rating === 1) {
@@ -56,6 +57,7 @@
tags = (message?.annotation?.tags ?? []).map((tag) => ({
name: tag
}));
+ detailedRating = message?.annotation?.details?.rating ?? null;
};
onMount(() => {
@@ -79,7 +81,10 @@
dispatch('save', {
reason: selectedReason,
comment: comment,
- tags: tags.map((tag) => tag.name)
+ tags: tags.map((tag) => tag.name),
+ details: {
+ rating: detailedRating
+ }
});
toast.success($i18n.t('Thanks for your feedback!'));
@@ -100,7 +105,9 @@
id="message-feedback-{message.id}"
>
- {#each reasons as reason}
-
- {/each}
+
+
+
+
+ {#each Array.from({ length: 10 }).map((_, i) => i + 1) as rating}
+
+ {/each}
+
+
+
+
+ 1 - {$i18n.t('Awful')}
+
+
+
+ 10 - {$i18n.t('Amazing')}
+
+
- {/if}
+
+
+
+ {#if reasons.length > 0}
+
{$i18n.t('Why?')}
+
+
+ {#each reasons as reason}
+
+ {/each}
+
+ {/if}
+