From 4002ead6afe2f4539493febc435c706860867590 Mon Sep 17 00:00:00 2001 From: Jun Siang Cheah Date: Sun, 19 May 2024 18:46:24 +0800 Subject: [PATCH] feat: store model configs in the database --- backend/apps/litellm/main.py | 14 +- backend/apps/ollama/main.py | 9 +- backend/apps/openai/main.py | 9 +- .../web/internal/migrations/008_add_models.py | 49 ++---- backend/apps/web/models/models.py | 157 ++++++++++++++++++ backend/config.py | 4 - backend/main.py | 46 +++-- src/lib/apis/index.ts | 18 +- src/lib/apis/litellm/index.ts | 2 +- src/lib/apis/openai/index.ts | 2 +- src/lib/components/chat/MessageInput.svelte | 82 ++++++--- .../chat/ModelSelector/Selector.svelte | 53 ++++-- .../components/chat/Settings/Models.svelte | 53 ++++-- .../components/workspace/Playground.svelte | 2 +- src/lib/i18n/locales/ar-BH/translation.json | 3 +- src/lib/i18n/locales/bg-BG/translation.json | 3 +- src/lib/i18n/locales/bn-BD/translation.json | 3 +- src/lib/i18n/locales/ca-ES/translation.json | 3 +- src/lib/i18n/locales/de-DE/translation.json | 3 +- src/lib/i18n/locales/dg-DG/translation.json | 3 +- src/lib/i18n/locales/en-GB/translation.json | 3 +- src/lib/i18n/locales/en-US/translation.json | 3 +- src/lib/i18n/locales/es-ES/translation.json | 3 +- src/lib/i18n/locales/fa-IR/translation.json | 3 +- src/lib/i18n/locales/fi-FI/translation.json | 3 +- src/lib/i18n/locales/fr-CA/translation.json | 3 +- src/lib/i18n/locales/fr-FR/translation.json | 3 +- src/lib/i18n/locales/he-IL/translation.json | 3 +- src/lib/i18n/locales/hi-IN/translation.json | 3 +- src/lib/i18n/locales/hr-HR/translation.json | 3 +- src/lib/i18n/locales/it-IT/translation.json | 3 +- src/lib/i18n/locales/ja-JP/translation.json | 3 +- src/lib/i18n/locales/ka-GE/translation.json | 3 +- src/lib/i18n/locales/ko-KR/translation.json | 3 +- src/lib/i18n/locales/nl-NL/translation.json | 3 +- src/lib/i18n/locales/pa-IN/translation.json | 3 +- src/lib/i18n/locales/pl-PL/translation.json | 3 +- src/lib/i18n/locales/pt-BR/translation.json | 3 +- src/lib/i18n/locales/pt-PT/translation.json | 3 +- src/lib/i18n/locales/ru-RU/translation.json | 3 +- src/lib/i18n/locales/sr-RS/translation.json | 3 +- src/lib/i18n/locales/sv-SE/translation.json | 3 +- src/lib/i18n/locales/tr-TR/translation.json | 3 +- src/lib/i18n/locales/uk-UA/translation.json | 3 +- src/lib/i18n/locales/vi-VN/translation.json | 3 +- src/lib/i18n/locales/zh-CN/translation.json | 3 +- src/lib/i18n/locales/zh-TW/translation.json | 3 +- src/lib/stores/index.ts | 23 +-- src/routes/(app)/+page.svelte | 3 +- src/routes/(app)/c/[id]/+page.svelte | 3 +- 50 files changed, 434 insertions(+), 194 deletions(-) diff --git a/backend/apps/litellm/main.py b/backend/apps/litellm/main.py index 35cb2bd54..9286c36d5 100644 --- a/backend/apps/litellm/main.py +++ b/backend/apps/litellm/main.py @@ -18,8 +18,9 @@ import requests from pydantic import BaseModel, ConfigDict from typing import Optional, List +from apps.web.models.models import Models from utils.utils import get_verified_user, get_current_user, get_admin_user -from config import SRC_LOG_LEVELS, ENV, MODEL_CONFIG +from config import SRC_LOG_LEVELS from constants import MESSAGES import os @@ -77,11 +78,12 @@ with open(LITELLM_CONFIG_DIR, "r") as file: app.state.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER.value app.state.MODEL_FILTER_LIST = MODEL_FILTER_LIST.value - +app.state.MODEL_CONFIG = [ + model.to_form() for model in Models.get_all_models_by_source("litellm") +] app.state.ENABLE = ENABLE_LITELLM app.state.CONFIG = litellm_config -app.state.MODEL_CONFIG = MODEL_CONFIG.value.get("litellm", []) # Global variable to store the subprocess reference background_process = None @@ -268,9 +270,9 @@ async def get_models(user=Depends(get_current_user)): ( item for item in app.state.MODEL_CONFIG - if item["name"] == model["model_name"] + if item.id == model["model_name"] ), - {}, + None, ), } for model in app.state.CONFIG["model_list"] @@ -286,7 +288,7 @@ async def get_models(user=Depends(get_current_user)): def add_custom_info_to_model(model: dict): model["custom_info"] = next( - (item for item in app.state.MODEL_CONFIG if item["id"] == model["id"]), {} + (item for item in app.state.MODEL_CONFIG if item.id == model["id"]), None ) diff --git a/backend/apps/ollama/main.py b/backend/apps/ollama/main.py index 2e9d36bc8..a310a25e0 100644 --- a/backend/apps/ollama/main.py +++ b/backend/apps/ollama/main.py @@ -29,7 +29,7 @@ import time from urllib.parse import urlparse from typing import Optional, List, Union - +from apps.web.models.models import Models from apps.web.models.users import Users from constants import ERROR_MESSAGES from utils.utils import ( @@ -46,7 +46,6 @@ from config import ( ENABLE_MODEL_FILTER, MODEL_FILTER_LIST, UPLOAD_DIR, - MODEL_CONFIG, AppConfig, ) from utils.misc import calculate_sha256 @@ -67,7 +66,9 @@ app.state.config = AppConfig() app.state.config.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER app.state.config.MODEL_FILTER_LIST = MODEL_FILTER_LIST -app.state.MODEL_CONFIG = MODEL_CONFIG.value.get("ollama", []) +app.state.MODEL_CONFIG = [ + model.to_form() for model in Models.get_all_models_by_source("ollama") +] app.state.config.OLLAMA_BASE_URLS = OLLAMA_BASE_URLS app.state.MODELS = {} @@ -179,7 +180,7 @@ async def get_all_models(): def add_custom_info_to_model(model: dict): model["custom_info"] = next( - (item for item in app.state.MODEL_CONFIG if item["id"] == model["model"]), {} + (item for item in app.state.MODEL_CONFIG if item.id == model["model"]), None ) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index e0c46e0c7..c5f35d315 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -10,7 +10,7 @@ import logging from pydantic import BaseModel - +from apps.web.models.models import Models from apps.web.models.users import Users from constants import ERROR_MESSAGES from utils.utils import ( @@ -27,7 +27,6 @@ from config import ( CACHE_DIR, ENABLE_MODEL_FILTER, MODEL_FILTER_LIST, - MODEL_CONFIG, AppConfig, ) from typing import List, Optional @@ -53,7 +52,9 @@ app.state.config = AppConfig() app.state.config.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER app.state.config.MODEL_FILTER_LIST = MODEL_FILTER_LIST -app.state.MODEL_CONFIG = MODEL_CONFIG.value.get("openai", []) +app.state.MODEL_CONFIG = [ + model.to_form() for model in Models.get_all_models_by_source("openai") +] app.state.config.ENABLE_OPENAI_API = ENABLE_OPENAI_API @@ -262,7 +263,7 @@ async def get_all_models(): def add_custom_info_to_model(model: dict): model["custom_info"] = next( - (item for item in app.state.MODEL_CONFIG if item["id"] == model["id"]), {} + (item for item in app.state.MODEL_CONFIG if item.id == model["id"]), None ) diff --git a/backend/apps/web/internal/migrations/008_add_models.py b/backend/apps/web/internal/migrations/008_add_models.py index dd176ba73..982927113 100644 --- a/backend/apps/web/internal/migrations/008_add_models.py +++ b/backend/apps/web/internal/migrations/008_add_models.py @@ -1,4 +1,4 @@ -"""Peewee migrations -- 002_add_local_sharing.py. +"""Peewee migrations -- 008_add_models.py. Some examples (model - class or model name):: @@ -37,43 +37,24 @@ with suppress(ImportError): def migrate(migrator: Migrator, database: pw.Database, *, fake=False): """Write your migrations here.""" - # Adding fields created_at and updated_at to the 'user' table - migrator.add_fields( - "user", - created_at=pw.BigIntegerField(null=True), # Allow null for transition - updated_at=pw.BigIntegerField(null=True), # Allow null for transition - last_active_at=pw.BigIntegerField(null=True), # Allow null for transition - ) + @migrator.create_model + class Model(pw.Model): + id = pw.TextField() + source = pw.TextField() + base_model = pw.TextField(null=True) + name = pw.TextField() + params = pw.TextField() - # Populate the new fields from an existing 'timestamp' field - migrator.sql( - 'UPDATE "user" SET created_at = timestamp, updated_at = timestamp, last_active_at = timestamp WHERE timestamp IS NOT NULL' - ) + class Meta: + table_name = "model" - # Now that the data has been copied, remove the original 'timestamp' field - migrator.remove_fields("user", "timestamp") - - # Update the fields to be not null now that they are populated - migrator.change_fields( - "user", - created_at=pw.BigIntegerField(null=False), - updated_at=pw.BigIntegerField(null=False), - last_active_at=pw.BigIntegerField(null=False), - ) + indexes = ( + # Create a unique index on the id, source columns + (("id", "source"), True), + ) def rollback(migrator: Migrator, database: pw.Database, *, fake=False): """Write your rollback migrations here.""" - # Recreate the timestamp field initially allowing null values for safe transition - migrator.add_fields("user", timestamp=pw.BigIntegerField(null=True)) - - # Copy the earliest created_at date back into the new timestamp field - # This assumes created_at was originally a copy of timestamp - migrator.sql('UPDATE "user" SET timestamp = created_at') - - # Remove the created_at and updated_at fields - migrator.remove_fields("user", "created_at", "updated_at", "last_active_at") - - # Finally, alter the timestamp field to not allow nulls if that was the original setting - migrator.change_fields("user", timestamp=pw.BigIntegerField(null=False)) + migrator.remove_model("model") diff --git a/backend/apps/web/models/models.py b/backend/apps/web/models/models.py index e69de29bb..1d7d0fce8 100644 --- a/backend/apps/web/models/models.py +++ b/backend/apps/web/models/models.py @@ -0,0 +1,157 @@ +import json +from typing import Optional + +import peewee as pw +from playhouse.shortcuts import model_to_dict +from pydantic import BaseModel + +from apps.web.internal.db import DB + + +#################### +# Models DB Schema +#################### + + +# ModelParams is a model for the data stored in the params field of the Model table +# It isn't currently used in the backend, but it's here as a reference +class ModelParams(BaseModel): + """ + A Pydantic model that represents the parameters of a model. + + Attributes: + description (str): A description of the model. + vision_capable (bool): A flag indicating if the model is capable of vision and thus image inputs. + """ + + description: str + vision_capable: bool + + +class Model(pw.Model): + id = pw.TextField() + """ + The model's id as used in the API. If set to an existing model, it will override the model. + """ + + source = pw.TextField() + """ + The source of the model, e.g., ollama, openai, or litellm. + """ + + base_model = pw.TextField(null=True) + """ + An optional pointer to the actual model that should be used when proxying requests. + Currently unused - but will be used to support Modelfile like behaviour in the future + """ + + name = pw.TextField() + """ + The human-readable display name of the model. + """ + + params = pw.TextField() + """ + Holds a JSON encoded blob of parameters, see `ModelParams`. + """ + + class Meta: + database = DB + + indexes = ( + # Create a unique index on the id, source columns + (("id", "source"), True), + ) + + +class ModelModel(BaseModel): + id: str + source: str + base_model: Optional[str] = None + name: str + params: str + + def to_form(self) -> "ModelForm": + return ModelForm(**{**self.model_dump(), "params": json.loads(self.params)}) + + +#################### +# Forms +#################### + + +class ModelForm(BaseModel): + id: str + source: str + base_model: Optional[str] = None + name: str + params: dict + + def to_db_model(self) -> ModelModel: + return ModelModel(**{**self.model_dump(), "params": json.dumps(self.params)}) + + +class ModelsTable: + + def __init__( + self, + db: pw.SqliteDatabase | pw.PostgresqlDatabase, + ): + self.db = db + self.db.create_tables([Model]) + + def get_all_models(self) -> list[ModelModel]: + return [ModelModel(**model_to_dict(model)) for model in Model.select()] + + def get_all_models_by_source(self, source: str) -> list[ModelModel]: + return [ + ModelModel(**model_to_dict(model)) + for model in Model.select().where(Model.source == source) + ] + + def update_all_models(self, models: list[ModelForm]) -> bool: + try: + with self.db.atomic(): + # Fetch current models from the database + current_models = self.get_all_models() + current_model_dict = { + (model.id, model.source): model for model in current_models + } + + # Create a set of model IDs and sources from the current models and the new models + current_model_keys = set(current_model_dict.keys()) + new_model_keys = set((model.id, model.source) for model in models) + + # Determine which models need to be created, updated, or deleted + models_to_create = [ + model + for model in models + if (model.id, model.source) not in current_model_keys + ] + models_to_update = [ + model + for model in models + if (model.id, model.source) in current_model_keys + ] + models_to_delete = current_model_keys - new_model_keys + + # Perform the necessary database operations + for model in models_to_create: + Model.create(**model.to_db_model().model_dump()) + + for model in models_to_update: + Model.update(**model.to_db_model().model_dump()).where( + (Model.id == model.id) & (Model.source == model.source) + ).execute() + + for model_id, model_source in models_to_delete: + Model.delete().where( + (Model.id == model_id) & (Model.source == model_source) + ).execute() + + return True + except Exception as e: + return False + + +Models = ModelsTable(DB) diff --git a/backend/config.py b/backend/config.py index 2e94e37bc..1a62e98bf 100644 --- a/backend/config.py +++ b/backend/config.py @@ -549,10 +549,6 @@ WEBHOOK_URL = PersistentConfig( ENABLE_ADMIN_EXPORT = os.environ.get("ENABLE_ADMIN_EXPORT", "True").lower() == "true" -MODEL_CONFIG = PersistentConfig( - "CONFIG_DATA", "models", {"ollama": [], "litellm": [], "openai": []} -) - #################################### # WEBUI_SECRET_KEY #################################### diff --git a/backend/main.py b/backend/main.py index aae6492cd..6892232b6 100644 --- a/backend/main.py +++ b/backend/main.py @@ -35,9 +35,9 @@ from apps.web.main import app as webui_app import asyncio from pydantic import BaseModel -from typing import List - +from typing import List, Optional +from apps.web.models.models import Models, ModelModel, ModelForm from utils.utils import get_admin_user from apps.rag.utils import rag_messages @@ -59,7 +59,6 @@ from config import ( SRC_LOG_LEVELS, WEBHOOK_URL, ENABLE_ADMIN_EXPORT, - MODEL_CONFIG, AppConfig, ) from constants import ERROR_MESSAGES @@ -113,7 +112,7 @@ app.state.config = AppConfig() app.state.config.ENABLE_MODEL_FILTER = ENABLE_MODEL_FILTER app.state.config.MODEL_FILTER_LIST = MODEL_FILTER_LIST -app.state.config.MODEL_CONFIG = MODEL_CONFIG +app.state.MODEL_CONFIG = [model.to_form() for model in Models.get_all_models()] app.state.config.WEBHOOK_URL = WEBHOOK_URL @@ -310,43 +309,40 @@ async def update_model_filter_config( } -class ModelConfig(BaseModel): - id: str - name: str - description: str - vision_capable: bool - - class SetModelConfigForm(BaseModel): - ollama: List[ModelConfig] - litellm: List[ModelConfig] - openai: List[ModelConfig] + models: List[ModelForm] @app.post("/api/config/models") async def update_model_config( form_data: SetModelConfigForm, user=Depends(get_admin_user) ): - data = form_data.model_dump() + if not Models.update_all_models(form_data.models): + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail=ERROR_MESSAGES.DEFAULT("Failed to update model config"), + ) - ollama_app.state.MODEL_CONFIG = data.get("ollama", []) + ollama_app.state.MODEL_CONFIG = [ + model for model in form_data.models if model.source == "ollama" + ] - openai_app.state.MODEL_CONFIG = data.get("openai", []) + openai_app.state.MODEL_CONFIG = [ + model for model in form_data.models if model.source == "openai" + ] - litellm_app.state.MODEL_CONFIG = data.get("litellm", []) + litellm_app.state.MODEL_CONFIG = [ + model for model in form_data.models if model.source == "litellm" + ] - app.state.config.MODEL_CONFIG = { - "ollama": ollama_app.state.MODEL_CONFIG, - "openai": openai_app.state.MODEL_CONFIG, - "litellm": litellm_app.state.MODEL_CONFIG, - } + app.state.MODEL_CONFIG = [model for model in form_data.models] - return {"models": app.state.config.MODEL_CONFIG} + return {"models": app.state.MODEL_CONFIG} @app.get("/api/config/models") async def get_model_config(user=Depends(get_admin_user)): - return {"models": app.state.config.MODEL_CONFIG} + return {"models": app.state.MODEL_CONFIG} @app.get("/api/webhook") diff --git a/src/lib/apis/index.ts b/src/lib/apis/index.ts index 9d0db99c0..d64ffb658 100644 --- a/src/lib/apis/index.ts +++ b/src/lib/apis/index.ts @@ -226,16 +226,18 @@ export const getModelConfig = async (token: string): Promise export interface ModelConfig { id: string; - name?: string; + name: string; + source: string; + base_model?: string; + params: ModelParams; +} + +export interface ModelParams { description?: string; vision_capable?: boolean; } -export interface GlobalModelConfig { - ollama: ModelConfig[]; - litellm: ModelConfig[]; - openai: ModelConfig[]; -} +export type GlobalModelConfig = ModelConfig[]; export const updateModelConfig = async (token: string, config: GlobalModelConfig) => { let error = null; @@ -246,7 +248,9 @@ export const updateModelConfig = async (token: string, config: GlobalModelConfig 'Content-Type': 'application/json', Authorization: `Bearer ${token}` }, - body: JSON.stringify(config) + body: JSON.stringify({ + models: config + }) }) .then(async (res) => { if (!res.ok) throw await res.json(); diff --git a/src/lib/apis/litellm/index.ts b/src/lib/apis/litellm/index.ts index 23e9f62b8..b1c24c5bd 100644 --- a/src/lib/apis/litellm/index.ts +++ b/src/lib/apis/litellm/index.ts @@ -34,7 +34,7 @@ export const getLiteLLMModels = async (token: string = '') => { name: model.name ?? model.id, external: true, source: 'LiteLLM', - custom_info: model.custom_info ?? {} + custom_info: model.custom_info })) .sort((a, b) => { return a.name.localeCompare(b.name); diff --git a/src/lib/apis/openai/index.ts b/src/lib/apis/openai/index.ts index b5f0f72bf..8afcec018 100644 --- a/src/lib/apis/openai/index.ts +++ b/src/lib/apis/openai/index.ts @@ -234,7 +234,7 @@ export const getOpenAIModels = async (token: string = '') => { id: model.id, name: model.name ?? model.id, external: true, - custom_info: model.custom_info ?? {} + custom_info: model.custom_info })) .sort((a, b) => { return a.name.localeCompare(b.name); diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index c3cb7e191..f7b519e87 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1,7 +1,7 @@ diff --git a/src/lib/components/workspace/Playground.svelte b/src/lib/components/workspace/Playground.svelte index a69144e7d..d84716455 100644 --- a/src/lib/components/workspace/Playground.svelte +++ b/src/lib/components/workspace/Playground.svelte @@ -325,7 +325,7 @@ .filter((model) => model.name !== 'hr') .map((model) => ({ value: model.id, - label: model.name, + label: model.custom_info?.name ?? model.name, info: model }))} bind:value={selectedModelId} diff --git a/src/lib/i18n/locales/ar-BH/translation.json b/src/lib/i18n/locales/ar-BH/translation.json index d80e726de..d90b038b8 100644 --- a/src/lib/i18n/locales/ar-BH/translation.json +++ b/src/lib/i18n/locales/ar-BH/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "التعليمات المتقدمة", "all": "الكل", "All Documents": "جميع الملفات", + "All selected models do not support image input, removed images": "", "All Users": "جميع المستخدمين", "Allow": "يسمح", "Allow Chat Deletion": "يستطيع حذف المحادثات", @@ -392,7 +393,7 @@ "Select a model": "أختار الموديل", "Select an Ollama instance": "أختار سيرفر ", "Select model": " أختار موديل", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "يُرجى إدخال طلبك هنا", "Send message": "يُرجى إدخال طلبك هنا.", diff --git a/src/lib/i18n/locales/bg-BG/translation.json b/src/lib/i18n/locales/bg-BG/translation.json index 0cadc0f5e..d9c6cbf9a 100644 --- a/src/lib/i18n/locales/bg-BG/translation.json +++ b/src/lib/i18n/locales/bg-BG/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Разширени Параметри", "all": "всички", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Всички Потребители", "Allow": "Позволи", "Allow Chat Deletion": "Позволи Изтриване на Чат", @@ -392,7 +393,7 @@ "Select a model": "Изберете модел", "Select an Ollama instance": "Изберете Ollama инстанция", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Изпращане на Съобщение", "Send message": "Изпращане на съобщение", diff --git a/src/lib/i18n/locales/bn-BD/translation.json b/src/lib/i18n/locales/bn-BD/translation.json index c4cf6056a..f2a947209 100644 --- a/src/lib/i18n/locales/bn-BD/translation.json +++ b/src/lib/i18n/locales/bn-BD/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "এডভান্সড প্যারামিটার্স", "all": "সব", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "সব ইউজার", "Allow": "অনুমোদন", "Allow Chat Deletion": "চ্যাট ডিলিট করতে দিন", @@ -392,7 +393,7 @@ "Select a model": "একটি মডেল নির্বাচন করুন", "Select an Ollama instance": "একটি Ollama ইন্সট্যান্স নির্বাচন করুন", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "একটি মেসেজ পাঠান", "Send message": "মেসেজ পাঠান", diff --git a/src/lib/i18n/locales/ca-ES/translation.json b/src/lib/i18n/locales/ca-ES/translation.json index 0db8bc170..fde747b53 100644 --- a/src/lib/i18n/locales/ca-ES/translation.json +++ b/src/lib/i18n/locales/ca-ES/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Paràmetres Avançats", "all": "tots", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Tots els Usuaris", "Allow": "Permet", "Allow Chat Deletion": "Permet la Supressió del Xat", @@ -392,7 +393,7 @@ "Select a model": "Selecciona un model", "Select an Ollama instance": "Selecciona una instància d'Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Envia un Missatge", "Send message": "Envia missatge", diff --git a/src/lib/i18n/locales/de-DE/translation.json b/src/lib/i18n/locales/de-DE/translation.json index b00893562..11c0ea7dd 100644 --- a/src/lib/i18n/locales/de-DE/translation.json +++ b/src/lib/i18n/locales/de-DE/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Erweiterte Parameter", "all": "Alle", "All Documents": "Alle Dokumente", + "All selected models do not support image input, removed images": "", "All Users": "Alle Benutzer", "Allow": "Erlauben", "Allow Chat Deletion": "Chat Löschung erlauben", @@ -392,7 +393,7 @@ "Select a model": "Ein Modell auswählen", "Select an Ollama instance": "Eine Ollama Instanz auswählen", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Eine Nachricht senden", "Send message": "Nachricht senden", diff --git a/src/lib/i18n/locales/dg-DG/translation.json b/src/lib/i18n/locales/dg-DG/translation.json index 0622ebc9e..3ab072e89 100644 --- a/src/lib/i18n/locales/dg-DG/translation.json +++ b/src/lib/i18n/locales/dg-DG/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Advanced Parameters", "all": "all", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "All Users", "Allow": "Allow", "Allow Chat Deletion": "Allow Delete Chats", @@ -392,7 +393,7 @@ "Select a model": "Select a model much choice", "Select an Ollama instance": "Select an Ollama instance very choose", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Send a Message much message", "Send message": "Send message very send", diff --git a/src/lib/i18n/locales/en-GB/translation.json b/src/lib/i18n/locales/en-GB/translation.json index 5f98fcc8b..9de54c229 100644 --- a/src/lib/i18n/locales/en-GB/translation.json +++ b/src/lib/i18n/locales/en-GB/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "", "all": "", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "", "Allow": "", "Allow Chat Deletion": "", @@ -392,7 +393,7 @@ "Select a model": "", "Select an Ollama instance": "", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "", "Send message": "", diff --git a/src/lib/i18n/locales/en-US/translation.json b/src/lib/i18n/locales/en-US/translation.json index 5f98fcc8b..9de54c229 100644 --- a/src/lib/i18n/locales/en-US/translation.json +++ b/src/lib/i18n/locales/en-US/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "", "all": "", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "", "Allow": "", "Allow Chat Deletion": "", @@ -392,7 +393,7 @@ "Select a model": "", "Select an Ollama instance": "", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "", "Send message": "", diff --git a/src/lib/i18n/locales/es-ES/translation.json b/src/lib/i18n/locales/es-ES/translation.json index e813bef82..5e0e0ab02 100644 --- a/src/lib/i18n/locales/es-ES/translation.json +++ b/src/lib/i18n/locales/es-ES/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Parámetros Avanzados", "all": "todo", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Todos los Usuarios", "Allow": "Permitir", "Allow Chat Deletion": "Permitir Borrar Chats", @@ -392,7 +393,7 @@ "Select a model": "Selecciona un modelo", "Select an Ollama instance": "Seleccione una instancia de Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Enviar un Mensaje", "Send message": "Enviar Mensaje", diff --git a/src/lib/i18n/locales/fa-IR/translation.json b/src/lib/i18n/locales/fa-IR/translation.json index dd8c135a0..fb64e6da8 100644 --- a/src/lib/i18n/locales/fa-IR/translation.json +++ b/src/lib/i18n/locales/fa-IR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "پارامترهای پیشرفته", "all": "همه", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "همه کاربران", "Allow": "اجازه دادن", "Allow Chat Deletion": "اجازه حذف گپ", @@ -392,7 +393,7 @@ "Select a model": "انتخاب یک مدل", "Select an Ollama instance": "انتخاب یک نمونه از اولاما", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "ارسال یک پیام", "Send message": "ارسال پیام", diff --git a/src/lib/i18n/locales/fi-FI/translation.json b/src/lib/i18n/locales/fi-FI/translation.json index 02240eb0d..ad63a5be1 100644 --- a/src/lib/i18n/locales/fi-FI/translation.json +++ b/src/lib/i18n/locales/fi-FI/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Edistyneet parametrit", "all": "kaikki", "All Documents": "Kaikki asiakirjat", + "All selected models do not support image input, removed images": "", "All Users": "Kaikki käyttäjät", "Allow": "Salli", "Allow Chat Deletion": "Salli keskustelujen poisto", @@ -392,7 +393,7 @@ "Select a model": "Valitse malli", "Select an Ollama instance": "Valitse Ollama-instanssi", "Select model": "Valitse malli", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Lähetä viesti", "Send message": "Lähetä viesti", diff --git a/src/lib/i18n/locales/fr-CA/translation.json b/src/lib/i18n/locales/fr-CA/translation.json index 1797617f4..152b82237 100644 --- a/src/lib/i18n/locales/fr-CA/translation.json +++ b/src/lib/i18n/locales/fr-CA/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Paramètres avancés", "all": "tous", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Tous les utilisateurs", "Allow": "Autoriser", "Allow Chat Deletion": "Autoriser la suppression des discussions", @@ -392,7 +393,7 @@ "Select a model": "Sélectionnez un modèle", "Select an Ollama instance": "Sélectionner une instance Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Envoyer un message", "Send message": "Envoyer un message", diff --git a/src/lib/i18n/locales/fr-FR/translation.json b/src/lib/i18n/locales/fr-FR/translation.json index 643104df0..f2625d642 100644 --- a/src/lib/i18n/locales/fr-FR/translation.json +++ b/src/lib/i18n/locales/fr-FR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Paramètres avancés", "all": "tous", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Tous les utilisateurs", "Allow": "Autoriser", "Allow Chat Deletion": "Autoriser la suppression du chat", @@ -392,7 +393,7 @@ "Select a model": "Sélectionner un modèle", "Select an Ollama instance": "Sélectionner une instance Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Envoyer un message", "Send message": "Envoyer un message", diff --git a/src/lib/i18n/locales/he-IL/translation.json b/src/lib/i18n/locales/he-IL/translation.json index ca2b3ebe3..1f9392d19 100644 --- a/src/lib/i18n/locales/he-IL/translation.json +++ b/src/lib/i18n/locales/he-IL/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "פרמטרים מתקדמים", "all": "הכל", "All Documents": "כל המסמכים", + "All selected models do not support image input, removed images": "", "All Users": "כל המשתמשים", "Allow": "אפשר", "Allow Chat Deletion": "אפשר מחיקת צ'אט", @@ -392,7 +393,7 @@ "Select a model": "בחר מודל", "Select an Ollama instance": "בחר מופע של Ollama", "Select model": "בחר מודל", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "שלח הודעה", "Send message": "שלח הודעה", diff --git a/src/lib/i18n/locales/hi-IN/translation.json b/src/lib/i18n/locales/hi-IN/translation.json index 3c4885d36..a3188db74 100644 --- a/src/lib/i18n/locales/hi-IN/translation.json +++ b/src/lib/i18n/locales/hi-IN/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "उन्नत पैरामीटर", "all": "सभी", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "सभी उपयोगकर्ता", "Allow": "अनुमति दें", "Allow Chat Deletion": "चैट हटाने की अनुमति दें", @@ -392,7 +393,7 @@ "Select a model": "एक मॉडल चुनें", "Select an Ollama instance": "एक Ollama Instance चुनें", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "एक संदेश भेजो", "Send message": "मेसेज भेजें", diff --git a/src/lib/i18n/locales/hr-HR/translation.json b/src/lib/i18n/locales/hr-HR/translation.json index 78d2d04ab..b02dea2f3 100644 --- a/src/lib/i18n/locales/hr-HR/translation.json +++ b/src/lib/i18n/locales/hr-HR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Napredni parametri", "all": "sve", "All Documents": "Svi dokumenti", + "All selected models do not support image input, removed images": "", "All Users": "Svi korisnici", "Allow": "Dopusti", "Allow Chat Deletion": "Dopusti brisanje razgovora", @@ -392,7 +393,7 @@ "Select a model": "Odaberite model", "Select an Ollama instance": "Odaberite Ollama instancu", "Select model": "Odaberite model", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Pošaljite poruku", "Send message": "Pošalji poruku", diff --git a/src/lib/i18n/locales/it-IT/translation.json b/src/lib/i18n/locales/it-IT/translation.json index aeb617c0f..94e73f9c7 100644 --- a/src/lib/i18n/locales/it-IT/translation.json +++ b/src/lib/i18n/locales/it-IT/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Parametri avanzati", "all": "tutti", "All Documents": "Tutti i documenti", + "All selected models do not support image input, removed images": "", "All Users": "Tutti gli utenti", "Allow": "Consenti", "Allow Chat Deletion": "Consenti l'eliminazione della chat", @@ -392,7 +393,7 @@ "Select a model": "Seleziona un modello", "Select an Ollama instance": "Seleziona un'istanza Ollama", "Select model": "Seleziona modello", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Invia un messaggio", "Send message": "Invia messaggio", diff --git a/src/lib/i18n/locales/ja-JP/translation.json b/src/lib/i18n/locales/ja-JP/translation.json index 18642847a..881f1b865 100644 --- a/src/lib/i18n/locales/ja-JP/translation.json +++ b/src/lib/i18n/locales/ja-JP/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "詳細パラメーター", "all": "すべて", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "すべてのユーザー", "Allow": "許可", "Allow Chat Deletion": "チャットの削除を許可", @@ -392,7 +393,7 @@ "Select a model": "モデルを選択", "Select an Ollama instance": "Ollama インスタンスを選択", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "メッセージを送信", "Send message": "メッセージを送信", diff --git a/src/lib/i18n/locales/ka-GE/translation.json b/src/lib/i18n/locales/ka-GE/translation.json index dc9b8c65e..cc13b3832 100644 --- a/src/lib/i18n/locales/ka-GE/translation.json +++ b/src/lib/i18n/locales/ka-GE/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "დამატებითი პარამეტრები", "all": "ყველა", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "ყველა მომხმარებელი", "Allow": "ნების დართვა", "Allow Chat Deletion": "მიმოწერის წაშლის დაშვება", @@ -392,7 +393,7 @@ "Select a model": "მოდელის არჩევა", "Select an Ollama instance": "", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "შეტყობინების გაგზავნა", "Send message": "შეტყობინების გაგზავნა", diff --git a/src/lib/i18n/locales/ko-KR/translation.json b/src/lib/i18n/locales/ko-KR/translation.json index f18ca01a8..c1dd795eb 100644 --- a/src/lib/i18n/locales/ko-KR/translation.json +++ b/src/lib/i18n/locales/ko-KR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "고급 매개변수", "all": "모두", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "모든 사용자", "Allow": "허용", "Allow Chat Deletion": "채팅 삭제 허용", @@ -392,7 +393,7 @@ "Select a model": "모델 선택", "Select an Ollama instance": "Ollama 인스턴스 선택", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "메시지 보내기", "Send message": "메시지 보내기", diff --git a/src/lib/i18n/locales/nl-NL/translation.json b/src/lib/i18n/locales/nl-NL/translation.json index 9e0e55b4f..11aab2285 100644 --- a/src/lib/i18n/locales/nl-NL/translation.json +++ b/src/lib/i18n/locales/nl-NL/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Geavanceerde Parameters", "all": "alle", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Alle Gebruikers", "Allow": "Toestaan", "Allow Chat Deletion": "Sta Chat Verwijdering toe", @@ -392,7 +393,7 @@ "Select a model": "Selecteer een model", "Select an Ollama instance": "Selecteer een Ollama instantie", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Stuur een Bericht", "Send message": "Stuur bericht", diff --git a/src/lib/i18n/locales/pa-IN/translation.json b/src/lib/i18n/locales/pa-IN/translation.json index acbf50463..83521510f 100644 --- a/src/lib/i18n/locales/pa-IN/translation.json +++ b/src/lib/i18n/locales/pa-IN/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "ਉੱਚ ਸਤਰ ਦੇ ਪੈਰਾਮੀਟਰ", "all": "ਸਾਰੇ", "All Documents": "ਸਾਰੇ ਡਾਕੂਮੈਂਟ", + "All selected models do not support image input, removed images": "", "All Users": "ਸਾਰੇ ਉਪਭੋਗਤਾ", "Allow": "ਅਨੁਮਤੀ", "Allow Chat Deletion": "ਗੱਲਬਾਤ ਮਿਟਾਉਣ ਦੀ ਆਗਿਆ ਦਿਓ", @@ -392,7 +393,7 @@ "Select a model": "ਇੱਕ ਮਾਡਲ ਚੁਣੋ", "Select an Ollama instance": "ਇੱਕ ਓਲਾਮਾ ਇੰਸਟੈਂਸ ਚੁਣੋ", "Select model": "ਮਾਡਲ ਚੁਣੋ", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "ਭੇਜੋ", "Send a Message": "ਇੱਕ ਸੁਨੇਹਾ ਭੇਜੋ", "Send message": "ਸੁਨੇਹਾ ਭੇਜੋ", diff --git a/src/lib/i18n/locales/pl-PL/translation.json b/src/lib/i18n/locales/pl-PL/translation.json index dccbeb38e..a4b5a0b35 100644 --- a/src/lib/i18n/locales/pl-PL/translation.json +++ b/src/lib/i18n/locales/pl-PL/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Zaawansowane parametry", "all": "wszyscy", "All Documents": "Wszystkie dokumenty", + "All selected models do not support image input, removed images": "", "All Users": "Wszyscy użytkownicy", "Allow": "Pozwól", "Allow Chat Deletion": "Pozwól na usuwanie czatu", @@ -392,7 +393,7 @@ "Select a model": "Wybierz model", "Select an Ollama instance": "Wybierz instancję Ollama", "Select model": "Wybierz model", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Wyślij Wiadomość", "Send message": "Wyślij wiadomość", diff --git a/src/lib/i18n/locales/pt-BR/translation.json b/src/lib/i18n/locales/pt-BR/translation.json index 52a3c6b76..0f5ec8de5 100644 --- a/src/lib/i18n/locales/pt-BR/translation.json +++ b/src/lib/i18n/locales/pt-BR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Parâmetros Avançados", "all": "todos", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Todos os Usuários", "Allow": "Permitir", "Allow Chat Deletion": "Permitir Exclusão de Bate-papo", @@ -392,7 +393,7 @@ "Select a model": "Selecione um modelo", "Select an Ollama instance": "Selecione uma instância Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Enviar uma Mensagem", "Send message": "Enviar mensagem", diff --git a/src/lib/i18n/locales/pt-PT/translation.json b/src/lib/i18n/locales/pt-PT/translation.json index ecc5f5f6a..25a99b317 100644 --- a/src/lib/i18n/locales/pt-PT/translation.json +++ b/src/lib/i18n/locales/pt-PT/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Parâmetros Avançados", "all": "todos", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Todos os Usuários", "Allow": "Permitir", "Allow Chat Deletion": "Permitir Exclusão de Bate-papo", @@ -392,7 +393,7 @@ "Select a model": "Selecione um modelo", "Select an Ollama instance": "Selecione uma instância Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Enviar uma Mensagem", "Send message": "Enviar mensagem", diff --git a/src/lib/i18n/locales/ru-RU/translation.json b/src/lib/i18n/locales/ru-RU/translation.json index f3ec4404f..4273cd89a 100644 --- a/src/lib/i18n/locales/ru-RU/translation.json +++ b/src/lib/i18n/locales/ru-RU/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Расширенные Параметры", "all": "всё", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Все пользователи", "Allow": "Разрешить", "Allow Chat Deletion": "Дозволять удаление чат", @@ -392,7 +393,7 @@ "Select a model": "Выберите модель", "Select an Ollama instance": "Выберите экземпляр Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Отправить сообщение", "Send message": "Отправить сообщение", diff --git a/src/lib/i18n/locales/sr-RS/translation.json b/src/lib/i18n/locales/sr-RS/translation.json index b1fb30e93..47c88169a 100644 --- a/src/lib/i18n/locales/sr-RS/translation.json +++ b/src/lib/i18n/locales/sr-RS/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Напредни параметри", "all": "сви", "All Documents": "Сви документи", + "All selected models do not support image input, removed images": "", "All Users": "Сви корисници", "Allow": "Дозволи", "Allow Chat Deletion": "Дозволи брисање ћаскања", @@ -392,7 +393,7 @@ "Select a model": "Изабери модел", "Select an Ollama instance": "Изабери Ollama инстанцу", "Select model": "Изабери модел", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Пошаљи поруку", "Send message": "Пошаљи поруку", diff --git a/src/lib/i18n/locales/sv-SE/translation.json b/src/lib/i18n/locales/sv-SE/translation.json index 84dca314b..f8c7f6012 100644 --- a/src/lib/i18n/locales/sv-SE/translation.json +++ b/src/lib/i18n/locales/sv-SE/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Avancerade parametrar", "all": "alla", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Alla användare", "Allow": "Tillåt", "Allow Chat Deletion": "Tillåt chattborttagning", @@ -392,7 +393,7 @@ "Select a model": "Välj en modell", "Select an Ollama instance": "Välj en Ollama-instans", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Skicka ett meddelande", "Send message": "Skicka meddelande", diff --git a/src/lib/i18n/locales/tr-TR/translation.json b/src/lib/i18n/locales/tr-TR/translation.json index 055b4a87f..f30ae511a 100644 --- a/src/lib/i18n/locales/tr-TR/translation.json +++ b/src/lib/i18n/locales/tr-TR/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Gelişmiş Parametreler", "all": "tümü", "All Documents": "Tüm Belgeler", + "All selected models do not support image input, removed images": "", "All Users": "Tüm Kullanıcılar", "Allow": "İzin ver", "Allow Chat Deletion": "Sohbet Silmeye İzin Ver", @@ -392,7 +393,7 @@ "Select a model": "Bir model seç", "Select an Ollama instance": "Bir Ollama örneği seçin", "Select model": "Model seç", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Bir Mesaj Gönder", "Send message": "Mesaj gönder", diff --git a/src/lib/i18n/locales/uk-UA/translation.json b/src/lib/i18n/locales/uk-UA/translation.json index a8918587d..3cfc4d3ae 100644 --- a/src/lib/i18n/locales/uk-UA/translation.json +++ b/src/lib/i18n/locales/uk-UA/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Розширені параметри", "all": "всі", "All Documents": "Усі документи", + "All selected models do not support image input, removed images": "", "All Users": "Всі користувачі", "Allow": "Дозволити", "Allow Chat Deletion": "Дозволити видалення чату", @@ -392,7 +393,7 @@ "Select a model": "Виберіть модель", "Select an Ollama instance": "Виберіть екземпляр Ollama", "Select model": "Вибрати модель", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Надіслати повідомлення", "Send message": "Надіслати повідомлення", diff --git a/src/lib/i18n/locales/vi-VN/translation.json b/src/lib/i18n/locales/vi-VN/translation.json index 4a81f4ab7..dc92f9f92 100644 --- a/src/lib/i18n/locales/vi-VN/translation.json +++ b/src/lib/i18n/locales/vi-VN/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "Các tham số Nâng cao", "all": "tất cả", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "Danh sách người sử dụng", "Allow": "Cho phép", "Allow Chat Deletion": "Cho phép Xóa nội dung chat", @@ -392,7 +393,7 @@ "Select a model": "Chọn mô hình", "Select an Ollama instance": "Chọn một thực thể Ollama", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "Gửi yêu cầu", "Send message": "Gửi yêu cầu", diff --git a/src/lib/i18n/locales/zh-CN/translation.json b/src/lib/i18n/locales/zh-CN/translation.json index cfe1f619c..ee86445ed 100644 --- a/src/lib/i18n/locales/zh-CN/translation.json +++ b/src/lib/i18n/locales/zh-CN/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "高级参数", "all": "所有", "All Documents": "所有文档", + "All selected models do not support image input, removed images": "", "All Users": "所有用户", "Allow": "允许", "Allow Chat Deletion": "允许删除聊天记录", @@ -392,7 +393,7 @@ "Select a model": "选择一个模型", "Select an Ollama instance": "选择一个 Ollama 实例", "Select model": "选择模型", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "发送", "Send a Message": "发送消息", "Send message": "发送消息", diff --git a/src/lib/i18n/locales/zh-TW/translation.json b/src/lib/i18n/locales/zh-TW/translation.json index 827a2f80c..a0db63e6b 100644 --- a/src/lib/i18n/locales/zh-TW/translation.json +++ b/src/lib/i18n/locales/zh-TW/translation.json @@ -29,6 +29,7 @@ "Advanced Parameters": "進階參數", "all": "所有", "All Documents": "", + "All selected models do not support image input, removed images": "", "All Users": "所有使用者", "Allow": "允許", "Allow Chat Deletion": "允許刪除聊天紀錄", @@ -392,7 +393,7 @@ "Select a model": "選擇一個模型", "Select an Ollama instance": "選擇 Ollama 實例", "Select model": "", - "Selected model does not support image inputs.": "", + "Selected models do not support image inputs": "", "Send": "", "Send a Message": "傳送訊息", "Send message": "傳送訊息", diff --git a/src/lib/stores/index.ts b/src/lib/stores/index.ts index 040b1c144..23f4ffde0 100644 --- a/src/lib/stores/index.ts +++ b/src/lib/stores/index.ts @@ -1,5 +1,6 @@ import { APP_NAME } from '$lib/constants'; import { type Writable, writable } from 'svelte/store'; +import type { GlobalModelConfig, ModelConfig } from '$lib/apis'; // Backend export const WEBUI_NAME = writable(APP_NAME); @@ -44,17 +45,10 @@ export const showChangelog = writable(false); export type Model = OpenAIModel | OllamaModel; -type ModelCustomInfo = { - id?: string; - name?: string; - description?: string; - vision_capable?: boolean; -}; - type BaseModel = { id: string; name: string; - custom_info?: ModelCustomInfo; + custom_info?: ModelConfig; }; export interface OpenAIModel extends BaseModel { @@ -143,19 +137,6 @@ type Config = { model_config?: GlobalModelConfig; }; -type GlobalModelConfig = { - ollama?: ModelConfig[]; - litellm?: ModelConfig[]; - openai?: ModelConfig[]; -}; - -type ModelConfig = { - id?: string; - name?: string; - description?: string; - vision_capable?: boolean; -}; - type PromptSuggestion = { content: string; title: [string, string]; diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index a7be32415..e42d194d2 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -265,7 +265,7 @@ const hasImages = messages.some((message) => message.files?.some((file) => file.type === 'image') ); - if (hasImages && !(model.custom_info?.vision_capable ?? true)) { + if (hasImages && !(model.custom_info?.params.vision_capable ?? true)) { toast.error( $i18n.t('Model {{modelName}} is not vision capable', { modelName: model.custom_info?.name ?? model.name ?? model.id @@ -949,6 +949,7 @@ bind:prompt bind:autoScroll bind:selectedModel={atSelectedModel} + {selectedModels} {messages} {submitPrompt} {stopResponse} diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index 3cc0a7b6b..15082c653 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -269,7 +269,7 @@ const hasImages = messages.some((message) => message.files?.some((file) => file.type === 'image') ); - if (hasImages && !(model.custom_info?.vision_capable ?? true)) { + if (hasImages && !(model.custom_info?.params.vision_capable ?? true)) { toast.error( $i18n.t('Model {{modelName}} is not vision capable', { modelName: model.custom_info?.name ?? model.name ?? model.id @@ -963,6 +963,7 @@ bind:prompt bind:autoScroll bind:selectedModel={atSelectedModel} + {selectedModels} {messages} {submitPrompt} {stopResponse}