From cddbeb023da5433d09256f50934f19247068aef1 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Fri, 31 May 2024 12:23:29 -0700 Subject: [PATCH] feat: model selector tag search --- .../chat/ModelSelector/Selector.svelte | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/ModelSelector/Selector.svelte b/src/lib/components/chat/ModelSelector/Selector.svelte index 8507f7a21..3bd02c762 100644 --- a/src/lib/components/chat/ModelSelector/Selector.svelte +++ b/src/lib/components/chat/ModelSelector/Selector.svelte @@ -42,10 +42,14 @@ let searchValue = ''; let ollamaVersion = null; - $: filteredItems = items.filter((item) => - searchValue - ? item.value.toLowerCase().includes(searchValue.toLowerCase()) - : true && !(item.model?.info?.meta?.hidden ?? false) + $: filteredItems = items.filter( + (item) => + (searchValue + ? item.value.toLowerCase().includes(searchValue.toLowerCase()) || + (item.model?.info?.meta?.tags ?? []).some((tag) => + tag.name.toLowerCase().includes(searchValue.toLowerCase()) + ) + : true) && !(item.model?.info?.meta?.hidden ?? false) ); const pullModelHandler = async () => { @@ -324,10 +328,22 @@ {/if} + + {#if (item?.model?.info?.meta?.tags ?? []).length > 0} +
+ {#each item.model?.info?.meta.tags as tag} +
+ {tag.name} +
+ {/each} +
+ {/if} {#if value === item.value} -
+
{/if}