From 3f81f96bda356fa875cb6772f6fc9af05deafb78 Mon Sep 17 00:00:00 2001 From: Zoe Date: Thu, 10 Sep 2026 04:25:37 -0500 Subject: [PATCH] feat: expand model icons, guard uploads, and handle seach env better --- app/components/ChatInput.vue | 4 +++ app/components/Logo/DotsStudio.vue | 29 +++++++++++++++++ app/components/Logo/NexAgi.vue | 31 +++++++++++++++++++ app/components/Logo/Poolside.vue | 7 ++--- app/components/Logo/ThinkingMachines.vue | 28 +++++++++++++++++ app/utils/model-mapping.ts | 21 +++++++++++-- server/api/topic/[topicId]/chat/index.post.ts | 5 ++- 7 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 app/components/Logo/DotsStudio.vue create mode 100644 app/components/Logo/NexAgi.vue create mode 100644 app/components/Logo/ThinkingMachines.vue diff --git a/app/components/ChatInput.vue b/app/components/ChatInput.vue index 6bd39e9..d7a4744 100644 --- a/app/components/ChatInput.vue +++ b/app/components/ChatInput.vue @@ -179,6 +179,10 @@ watch(() => props.agent?.defaultModelId, (newModelId) => { }) const handleSubmit = () => { + if (isUploading.value || hasFailedUploads.value) { + return; + } + if (props.loading) { emit('cancel'); return; diff --git a/app/components/Logo/DotsStudio.vue b/app/components/Logo/DotsStudio.vue new file mode 100644 index 0000000..711bf61 --- /dev/null +++ b/app/components/Logo/DotsStudio.vue @@ -0,0 +1,29 @@ + + + diff --git a/app/components/Logo/NexAgi.vue b/app/components/Logo/NexAgi.vue new file mode 100644 index 0000000..eeae7a3 --- /dev/null +++ b/app/components/Logo/NexAgi.vue @@ -0,0 +1,31 @@ + + + diff --git a/app/components/Logo/Poolside.vue b/app/components/Logo/Poolside.vue index 060cde5..361e573 100644 --- a/app/components/Logo/Poolside.vue +++ b/app/components/Logo/Poolside.vue @@ -16,17 +16,16 @@ const [a, b, c, d] = useFillIds(TITLE, 4); diff --git a/app/utils/model-mapping.ts b/app/utils/model-mapping.ts index 436361f..c3c4de2 100644 --- a/app/utils/model-mapping.ts +++ b/app/utils/model-mapping.ts @@ -54,6 +54,9 @@ import { LogoClosedRouter, LogoPoolside, LogoTencent, + LogoThinkingMachines, + LogoDotsStudio, + LogoNexAgi, LogoHuggingFace, } from '#components'; import { markRaw } from 'vue'; @@ -65,6 +68,18 @@ interface ModelConfig { } const MODEL_MAPPINGS: ModelConfig[] = [ + { + Icon: markRaw(LogoNexAgi), + keywords: [/nex-agi\//, /\/nex-/], + }, + { + Icon: markRaw(LogoDotsStudio), + keywords: [/dots-studio/, /^dots/, /\/dots/], + }, + { + Icon: markRaw(LogoThinkingMachines), + keywords: [/^thinkingmachines\//, /\/linkling/], + }, { Icon: markRaw(LogoOpenAI), keywords: [/gpt-3/], props: { type: 'gpt3' } }, { Icon: markRaw(LogoOpenAI), keywords: [/gpt-4/], props: { type: 'gpt4' } }, { Icon: markRaw(LogoOpenAI), keywords: [/gpt-5/], props: { type: 'gpt5' } }, @@ -99,7 +114,7 @@ const MODEL_MAPPINGS: ModelConfig[] = [ }, { Icon: markRaw(LogoGrok), - keywords: [/^grok-/, /^x-ai\//], + keywords: [/^grok-/, /^x-ai\//, /^~x-ai\/grok-latest$/], }, { Icon: markRaw(LogoGemini), @@ -164,7 +179,7 @@ const MODEL_MAPPINGS: ModelConfig[] = [ }, { Icon: markRaw(LogoZAI), - keywords: [/zai-/, /(^|\/|-)?glm-?\d/] + keywords: [/zai-/, /(^|\/|-)?glm-?\d/, /^~z-ai\/glm-(flash-)?latest$/] }, { Icon: markRaw(LogoGLMV), @@ -196,7 +211,7 @@ const MODEL_MAPPINGS: ModelConfig[] = [ }, { Icon: markRaw(LogoMeta), - keywords: [/llama/, /\/l3/, /meta-llama\//] + keywords: [/llama/, /\/l3/, /meta-llama\//, /(^|\/)muse-spark($|-)/, /^meta\//] }, { Icon: markRaw(LogoPerplexity), diff --git a/server/api/topic/[topicId]/chat/index.post.ts b/server/api/topic/[topicId]/chat/index.post.ts index 49dd853..60a88a7 100644 --- a/server/api/topic/[topicId]/chat/index.post.ts +++ b/server/api/topic/[topicId]/chat/index.post.ts @@ -431,13 +431,16 @@ type SearchTheWebConfig = SearchTheWebRerankedConfig | SearchTheWebUnrankedConfi export const searchTheWeb = (config: SearchTheWebConfig) => { return async (query: string) => { + const searchUrl = new URL(process.env.SEARCH_API_URL ?? process.env.SEARXNG_URL ?? ""); + searchUrl.pathname = `${searchUrl.pathname.replace(/\/+$/, "")}/search`; + const results = await $fetch<{ results: Array<{ title: string; url: string; content: string; }>; - }>(`${process.env.SEARXNG_URL}/search`, { + }>(searchUrl.toString(), { query: { q: query, format: 'json',