|
@@ -2,7 +2,7 @@
|
|
|
import { toast } from 'svelte-sonner';
|
|
|
|
|
|
import { createEventDispatcher, onMount, getContext } from 'svelte';
|
|
|
- import { config } from '$lib/stores';
|
|
|
+ import { config, models } from '$lib/stores';
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
|
|
|
@@ -39,6 +39,8 @@
|
|
|
let selectedReason = null;
|
|
|
let comment = '';
|
|
|
|
|
|
+ let selectedModel = null;
|
|
|
+
|
|
|
$: if (message?.annotation?.rating === 1) {
|
|
|
reasons = LIKE_REASONS;
|
|
|
} else if (message?.annotation?.rating === -1) {
|
|
@@ -48,6 +50,16 @@
|
|
|
onMount(() => {
|
|
|
selectedReason = message?.annotation?.reason ?? '';
|
|
|
comment = message?.annotation?.comment ?? '';
|
|
|
+
|
|
|
+ if (message?.arena) {
|
|
|
+ selectedModel = $models.find((m) => m.id === message.selectedModelId);
|
|
|
+ toast.success(
|
|
|
+ $i18n.t('This response was generated by "{{model}}"', {
|
|
|
+ model: selectedModel.name
|
|
|
+ })
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
loadReasons();
|
|
|
});
|
|
|
|
|
@@ -69,6 +81,12 @@
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
+{#if selectedModel}
|
|
|
+ <div class="text-xs font-medium translate-y-1.5">
|
|
|
+ {$i18n.t('This response was generated by "{{model}}"', { model: selectedModel.name })}
|
|
|
+ </div>
|
|
|
+{/if}
|
|
|
+
|
|
|
<div
|
|
|
class=" my-2.5 rounded-xl px-4 py-3 border border-gray-50 dark:border-gray-850"
|
|
|
id="message-feedback-{message.id}"
|