瀏覽代碼

feat: add warning icon to images when some models are not vision capable

Jun Siang Cheah 11 月之前
父節點
當前提交
fa4c22492f
共有 35 個文件被更改,包括 61 次插入2 次删除
  1. 26 1
      src/lib/components/chat/MessageInput.svelte
  2. 2 1
      src/lib/components/common/Tooltip.svelte
  3. 1 0
      src/lib/i18n/locales/ar-BH/translation.json
  4. 1 0
      src/lib/i18n/locales/bg-BG/translation.json
  5. 1 0
      src/lib/i18n/locales/bn-BD/translation.json
  6. 1 0
      src/lib/i18n/locales/ca-ES/translation.json
  7. 1 0
      src/lib/i18n/locales/de-DE/translation.json
  8. 1 0
      src/lib/i18n/locales/dg-DG/translation.json
  9. 1 0
      src/lib/i18n/locales/en-GB/translation.json
  10. 1 0
      src/lib/i18n/locales/en-US/translation.json
  11. 1 0
      src/lib/i18n/locales/es-ES/translation.json
  12. 1 0
      src/lib/i18n/locales/fa-IR/translation.json
  13. 1 0
      src/lib/i18n/locales/fi-FI/translation.json
  14. 1 0
      src/lib/i18n/locales/fr-CA/translation.json
  15. 1 0
      src/lib/i18n/locales/fr-FR/translation.json
  16. 1 0
      src/lib/i18n/locales/he-IL/translation.json
  17. 1 0
      src/lib/i18n/locales/hi-IN/translation.json
  18. 1 0
      src/lib/i18n/locales/hr-HR/translation.json
  19. 1 0
      src/lib/i18n/locales/it-IT/translation.json
  20. 1 0
      src/lib/i18n/locales/ja-JP/translation.json
  21. 1 0
      src/lib/i18n/locales/ka-GE/translation.json
  22. 1 0
      src/lib/i18n/locales/ko-KR/translation.json
  23. 1 0
      src/lib/i18n/locales/nl-NL/translation.json
  24. 1 0
      src/lib/i18n/locales/pa-IN/translation.json
  25. 1 0
      src/lib/i18n/locales/pl-PL/translation.json
  26. 1 0
      src/lib/i18n/locales/pt-BR/translation.json
  27. 1 0
      src/lib/i18n/locales/pt-PT/translation.json
  28. 1 0
      src/lib/i18n/locales/ru-RU/translation.json
  29. 1 0
      src/lib/i18n/locales/sr-RS/translation.json
  30. 1 0
      src/lib/i18n/locales/sv-SE/translation.json
  31. 1 0
      src/lib/i18n/locales/tr-TR/translation.json
  32. 1 0
      src/lib/i18n/locales/uk-UA/translation.json
  33. 1 0
      src/lib/i18n/locales/vi-VN/translation.json
  34. 1 0
      src/lib/i18n/locales/zh-CN/translation.json
  35. 1 0
      src/lib/i18n/locales/zh-TW/translation.json

+ 26 - 1
src/lib/components/chat/MessageInput.svelte

@@ -653,7 +653,32 @@
 								{#each files as file, fileIdx}
 									<div class=" relative group">
 										{#if file.type === 'image'}
-											<img src={file.url} alt="input" class=" h-16 w-16 rounded-xl object-cover" />
+											<div class="relative">
+												<img
+													src={file.url}
+													alt="input"
+													class=" h-16 w-16 rounded-xl object-cover"
+												/>
+												{#if visionCapableState === 'some'}
+													<Tooltip
+														className=" absolute top-0 left-0"
+														content={$i18n.t('A selected model does not support image input')}
+													>
+														<svg
+															xmlns="http://www.w3.org/2000/svg"
+															viewBox="0 0 24 24"
+															fill="currentColor"
+															class="w-6 h-6 fill-yellow-300"
+														>
+															<path
+																fill-rule="evenodd"
+																d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z"
+																clip-rule="evenodd"
+															/>
+														</svg>
+													</Tooltip>
+												{/if}
+											</div>
 										{:else if file.type === 'doc'}
 											<div
 												class="h-16 w-[15rem] flex items-center space-x-3 px-2.5 dark:bg-gray-600 rounded-xl border border-gray-200 dark:border-none"

+ 2 - 1
src/lib/components/common/Tooltip.svelte

@@ -5,6 +5,7 @@
 	export let placement = 'top';
 	export let content = `I'm a tooltip!`;
 	export let touch = true;
+	export let className = 'flex';
 
 	let tooltipElement;
 	let tooltipInstance;
@@ -29,6 +30,6 @@
 	});
 </script>
 
-<div bind:this={tooltipElement} aria-label={content} class="flex">
+<div bind:this={tooltipElement} aria-label={content} class={className}>
 	<slot />
 </div>

+ 1 - 0
src/lib/i18n/locales/ar-BH/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} ...يفكر",
 	"{{user}}'s Chats": "{{user}}' الدردشات",
 	"{{webUIName}} Backend Required": "{{webUIName}} مطلوب",
+  "A selected model does not support image input": "",
 	"a user": "المستخدم",
 	"About": "عن",
 	"Account": "الحساب",

+ 1 - 0
src/lib/i18n/locales/bg-BG/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} мисли ...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Изисква се Бекенд",
+  "A selected model does not support image input": "",
 	"a user": "потребител",
 	"About": "Относно",
 	"Account": "Акаунт",

+ 1 - 0
src/lib/i18n/locales/bn-BD/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} চিন্তা করছে...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} ব্যাকএন্ড আবশ্যক",
+  "A selected model does not support image input": "",
 	"a user": "একজন ব্যাবহারকারী",
 	"About": "সম্পর্কে",
 	"Account": "একাউন্ট",

+ 1 - 0
src/lib/i18n/locales/ca-ES/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} està pensant...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "Es requereix Backend de {{webUIName}}",
+  "A selected model does not support image input": "",
 	"a user": "un usuari",
 	"About": "Sobre",
 	"Account": "Compte",

+ 1 - 0
src/lib/i18n/locales/de-DE/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} denkt nach...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}}-Backend erforderlich",
+  "A selected model does not support image input": "",
 	"a user": "ein Benutzer",
 	"About": "Über",
 	"Account": "Account",

+ 1 - 0
src/lib/i18n/locales/dg-DG/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} is thinkin'...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend Much Required",
+  "A selected model does not support image input": "",
 	"a user": "such user",
 	"About": "Much About",
 	"Account": "Account",

+ 1 - 0
src/lib/i18n/locales/en-GB/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "",
+  "A selected model does not support image input": "",
 	"a user": "",
 	"About": "",
 	"Account": "",

+ 1 - 0
src/lib/i18n/locales/en-US/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "",
+  "A selected model does not support image input": "",
 	"a user": "",
 	"About": "",
 	"Account": "",

+ 1 - 0
src/lib/i18n/locales/es-ES/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} está pensando...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Servidor Requerido",
+  "A selected model does not support image input": "",
 	"a user": "un usuario",
 	"About": "Sobre nosotros",
 	"Account": "Cuenta",

+ 1 - 0
src/lib/i18n/locales/fa-IR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} در حال فکر کردن است...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "بکند {{webUIName}} نیاز است.",
+  "A selected model does not support image input": "",
 	"a user": "یک کاربر",
 	"About": "درباره",
 	"Account": "حساب کاربری",

+ 1 - 0
src/lib/i18n/locales/fi-FI/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} miettii...",
 	"{{user}}'s Chats": "{{user}}:n keskustelut",
 	"{{webUIName}} Backend Required": "{{webUIName}} backend vaaditaan",
+  "A selected model does not support image input": "",
 	"a user": "käyttäjä",
 	"About": "Tietoja",
 	"Account": "Tili",

+ 1 - 0
src/lib/i18n/locales/fr-CA/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} réfléchit...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "Backend {{webUIName}} requis",
+  "A selected model does not support image input": "",
 	"a user": "un utilisateur",
 	"About": "À propos",
 	"Account": "Compte",

+ 1 - 0
src/lib/i18n/locales/fr-FR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} réfléchit...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "Backend {{webUIName}} requis",
+  "A selected model does not support image input": "",
 	"a user": "un utilisateur",
 	"About": "À propos",
 	"Account": "Compte",

+ 1 - 0
src/lib/i18n/locales/he-IL/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} חושב...",
 	"{{user}}'s Chats": "צ'אטים של {{user}}",
 	"{{webUIName}} Backend Required": "נדרש Backend של {{webUIName}}",
+  "A selected model does not support image input": "",
 	"a user": "משתמש",
 	"About": "אודות",
 	"Account": "חשבון",

+ 1 - 0
src/lib/i18n/locales/hi-IN/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} सोच रहा है...",
 	"{{user}}'s Chats": "{{user}} की चैट",
 	"{{webUIName}} Backend Required": "{{webUIName}} बैकएंड आवश्यक",
+  "A selected model does not support image input": "",
 	"a user": "एक उपयोगकर्ता",
 	"About": "हमारे बारे में",
 	"Account": "खाता",

+ 1 - 0
src/lib/i18n/locales/hr-HR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} razmišlja...",
 	"{{user}}'s Chats": "Razgovori korisnika {{user}}",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend je potreban",
+  "A selected model does not support image input": "",
 	"a user": "korisnik",
 	"About": "O",
 	"Account": "Račun",

+ 1 - 0
src/lib/i18n/locales/it-IT/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} sta pensando...",
 	"{{user}}'s Chats": "{{user}} Chat",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend richiesto",
+  "A selected model does not support image input": "",
 	"a user": "un utente",
 	"About": "Informazioni",
 	"Account": "Account",

+ 1 - 0
src/lib/i18n/locales/ja-JP/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} は思考中です...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} バックエンドが必要です",
+  "A selected model does not support image input": "",
 	"a user": "ユーザー",
 	"About": "概要",
 	"Account": "アカウント",

+ 1 - 0
src/lib/i18n/locales/ka-GE/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} ფიქრობს...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} საჭიროა ბექენდი",
+  "A selected model does not support image input": "",
 	"a user": "მომხმარებელი",
 	"About": "შესახებ",
 	"Account": "ანგარიში",

+ 1 - 0
src/lib/i18n/locales/ko-KR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} 이(가) 생각중입니다....",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} 백엔드가 필요합니다.",
+  "A selected model does not support image input": "",
 	"a user": "사용자",
 	"About": "소개",
 	"Account": "계정",

+ 1 - 0
src/lib/i18n/locales/nl-NL/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} is aan het denken...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend Verlpicht",
+  "A selected model does not support image input": "",
 	"a user": "een gebruiker",
 	"About": "Over",
 	"Account": "Account",

+ 1 - 0
src/lib/i18n/locales/pa-IN/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} ਸੋਚ ਰਿਹਾ ਹੈ...",
 	"{{user}}'s Chats": "{{user}} ਦੀਆਂ ਗੱਲਾਂ",
 	"{{webUIName}} Backend Required": "{{webUIName}} ਬੈਕਐਂਡ ਲੋੜੀਂਦਾ ਹੈ",
+  "A selected model does not support image input": "",
 	"a user": "ਇੱਕ ਉਪਭੋਗਤਾ",
 	"About": "ਬਾਰੇ",
 	"Account": "ਖਾਤਾ",

+ 1 - 0
src/lib/i18n/locales/pl-PL/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} myśli...",
 	"{{user}}'s Chats": "{{user}} - czaty",
 	"{{webUIName}} Backend Required": "Backend {{webUIName}} wymagane",
+  "A selected model does not support image input": "",
 	"a user": "użytkownik",
 	"About": "O nas",
 	"Account": "Konto",

+ 1 - 0
src/lib/i18n/locales/pt-BR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} está pensando...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend Necessário",
+  "A selected model does not support image input": "",
 	"a user": "um usuário",
 	"About": "Sobre",
 	"Account": "Conta",

+ 1 - 0
src/lib/i18n/locales/pt-PT/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} está pensando...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend Necessário",
+  "A selected model does not support image input": "",
 	"a user": "um usuário",
 	"About": "Sobre",
 	"Account": "Conta",

+ 1 - 0
src/lib/i18n/locales/ru-RU/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} думает...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} бэкенд требуемый",
+  "A selected model does not support image input": "",
 	"a user": "пользователь",
 	"About": "Об",
 	"Account": "Аккаунт",

+ 1 - 0
src/lib/i18n/locales/sr-RS/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} размишља...",
 	"{{user}}'s Chats": "Ћаскања корисника {{user}}",
 	"{{webUIName}} Backend Required": "Захтева се {{webUIName}} позадинац",
+  "A selected model does not support image input": "",
 	"a user": "корисник",
 	"About": "О нама",
 	"Account": "Налог",

+ 1 - 0
src/lib/i18n/locales/sv-SE/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} tänker...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Backend krävs",
+  "A selected model does not support image input": "",
 	"a user": "en användare",
 	"About": "Om",
 	"Account": "Konto",

+ 1 - 0
src/lib/i18n/locales/tr-TR/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} düşünüyor...",
 	"{{user}}'s Chats": "{{user}} Sohbetleri",
 	"{{webUIName}} Backend Required": "{{webUIName}} Arkayüz Gerekli",
+  "A selected model does not support image input": "",
 	"a user": "bir kullanıcı",
 	"About": "Hakkında",
 	"Account": "Hesap",

+ 1 - 0
src/lib/i18n/locales/uk-UA/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} думає...",
 	"{{user}}'s Chats": "Чати {{user}}а",
 	"{{webUIName}} Backend Required": "Необхідно підключення бекенду {{webUIName}}",
+  "A selected model does not support image input": "",
 	"a user": "користувача",
 	"About": "Про програму",
 	"Account": "Обліковий запис",

+ 1 - 0
src/lib/i18n/locales/vi-VN/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} đang suy nghĩ...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "{{webUIName}} Yêu cầu Backend",
+  "A selected model does not support image input": "",
 	"a user": "người sử dụng",
 	"About": "Giới thiệu",
 	"Account": "Tài khoản",

+ 1 - 0
src/lib/i18n/locales/zh-CN/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} 正在思考...",
 	"{{user}}'s Chats": "{{user}} 的聊天记录",
 	"{{webUIName}} Backend Required": "需要 {{webUIName}} 后端",
+  "A selected model does not support image input": "",
 	"a user": "用户",
 	"About": "关于",
 	"Account": "账户",

+ 1 - 0
src/lib/i18n/locales/zh-TW/translation.json

@@ -6,6 +6,7 @@
 	"{{modelName}} is thinking...": "{{modelName}} 正在思考...",
 	"{{user}}'s Chats": "",
 	"{{webUIName}} Backend Required": "需要 {{webUIName}} 後台",
+  "A selected model does not support image input": "",
 	"a user": "使用者",
 	"About": "關於",
 	"Account": "帳號",