diff --git a/src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts b/src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts index f7a775aba..8e59aeef9 100644 --- a/src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts +++ b/src/main/presenter/knowledgePresenter/knowledgeStorePresenter.ts @@ -75,9 +75,11 @@ export class KnowledgeStorePresenter { } } as KnowledgeFileMessage - fileId - ? await this.vectorP.updateFile(fileMessage) - : await this.vectorP.insertFile(fileMessage) + if (fileId) { + await this.vectorP.updateFile(fileMessage) + } else { + await this.vectorP.insertFile(fileMessage) + } this.processFileAsync(fileMessage) diff --git a/src/renderer/src/assets/style.css b/src/renderer/src/assets/style.css index 7d3383194..8136a0241 100644 --- a/src/renderer/src/assets/style.css +++ b/src/renderer/src/assets/style.css @@ -276,11 +276,13 @@ } * { - @apply border-border outline-ring/50; + border-color: var(--border); + outline-color: color-mix(in oklab, var(--ring) 50%, transparent); } body { - @apply bg-background text-foreground; + background-color: var(--background); + color: var(--foreground); font-weight: var(--text-weight); } diff --git a/src/renderer/src/components/message/MessageBlockThink.vue b/src/renderer/src/components/message/MessageBlockThink.vue index 62fa512d8..fa6533cdd 100644 --- a/src/renderer/src/components/message/MessageBlockThink.vue +++ b/src/renderer/src/components/message/MessageBlockThink.vue @@ -1,50 +1,20 @@ - - - - - - - {{ - block.status === 'loading' - ? t('chat.features.deepThinkingProgress') - : t('chat.features.deepThinking') - }} - {{ - reasoningDuration > 0 ? t('chat.features.thinkingDuration', [reasoningDuration]) : '' - }} - - - - - - - - + + + diff --git a/src/renderer/src/components/think-content/index.ts b/src/renderer/src/components/think-content/index.ts new file mode 100644 index 000000000..709bc19b5 --- /dev/null +++ b/src/renderer/src/components/think-content/index.ts @@ -0,0 +1 @@ +export { default as ThinkContent } from './ThinkContent.vue' diff --git a/src/renderer/src/i18n/en-US/chat.json b/src/renderer/src/i18n/en-US/chat.json index 45a531a58..ffd723070 100644 --- a/src/renderer/src/i18n/en-US/chat.json +++ b/src/renderer/src/i18n/en-US/chat.json @@ -19,10 +19,9 @@ "rateLimitWaitingTooltip": "Wait {seconds}s more, {interval}s interval" }, "features": { - "deepThinking": "Deep Thinking", "webSearch": "Web Search", - "deepThinkingProgress": "Deep Thinking in progress...", - "thinkingDuration": "(Took {0} seconds)", + "thoughtForSeconds": "Thought for {seconds}s", + "thoughtForSecondsLoading": "Thinking for {seconds}s...", "artifactThinking": "Artifact Thinking" }, "search": { diff --git a/src/renderer/src/i18n/fa-IR/chat.json b/src/renderer/src/i18n/fa-IR/chat.json index 475f0ae3c..34c674b70 100644 --- a/src/renderer/src/i18n/fa-IR/chat.json +++ b/src/renderer/src/i18n/fa-IR/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "باید {seconds} ثانیه دیگر منتظر بمانید، فاصله {interval} ثانیه" }, "features": { - "deepThinking": "تفکر عمیق", "webSearch": "جستجوی وب", - "deepThinkingProgress": "در حال تفکر عمیق...", - "thinkingDuration": "({0} ثانیه طول کشید)", - "artifactThinking": "تفکر مصنوعی" + "artifactThinking": "تفکر مصنوعی", + "thoughtForSeconds": "تفکر به مدت {seconds} ثانیه", + "thoughtForSecondsLoading": "در حال تفکر ({seconds} ثانیه)" }, "search": { "results": "{0} صفحه وب یافت شد", diff --git a/src/renderer/src/i18n/fr-FR/chat.json b/src/renderer/src/i18n/fr-FR/chat.json index a84b59549..e57806bf0 100644 --- a/src/renderer/src/i18n/fr-FR/chat.json +++ b/src/renderer/src/i18n/fr-FR/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "Attendre encore {seconds} secondes, intervalle {interval} secondes" }, "features": { - "deepThinking": "Réflexion approfondie", "webSearch": "Recherche web", - "deepThinkingProgress": "Réflexion approfondie en cours...", - "thinkingDuration": "(A pris {0} secondes)", - "artifactThinking": "Réflexion sur les artefacts" + "artifactThinking": "Réflexion sur les artefacts", + "thoughtForSeconds": "Réflexion pendant {seconds}s", + "thoughtForSecondsLoading": "Réflexion en cours ({seconds}s)" }, "search": { "results": "{0} pages web trouvées", diff --git a/src/renderer/src/i18n/ja-JP/chat.json b/src/renderer/src/i18n/ja-JP/chat.json index 9e5807348..2ef90ddba 100644 --- a/src/renderer/src/i18n/ja-JP/chat.json +++ b/src/renderer/src/i18n/ja-JP/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "あと{seconds}秒待機、間隔{interval}秒" }, "features": { - "deepThinking": "深い思考", "webSearch": "ウェブ検索", - "deepThinkingProgress": "深い思考中...", - "thinkingDuration": "({0}秒かかりました)", - "artifactThinking": "アーティファクト思考" + "artifactThinking": "アーティファクト思考", + "thoughtForSeconds": "{seconds}秒間思考しました", + "thoughtForSecondsLoading": "{seconds}秒間思考中..." }, "search": { "results": "{0}件のウェブページが見つかりました", diff --git a/src/renderer/src/i18n/ko-KR/chat.json b/src/renderer/src/i18n/ko-KR/chat.json index 9c5b8d389..bd80bc80c 100644 --- a/src/renderer/src/i18n/ko-KR/chat.json +++ b/src/renderer/src/i18n/ko-KR/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "{seconds}초 더 대기, 간격 {interval}초" }, "features": { - "deepThinking": "심층 사고", "webSearch": "웹 검색", - "deepThinkingProgress": "심층 사고 진행 중...", - "thinkingDuration": "({0}초 소요)", - "artifactThinking": "아티팩트 추론" + "artifactThinking": "아티팩트 추론", + "thoughtForSeconds": "{seconds}초 동안 생각했습니다", + "thoughtForSecondsLoading": "{seconds}초째 생각 중..." }, "search": { "results": "{0}개의 웹 페이지를 찾았습니다", diff --git a/src/renderer/src/i18n/ru-RU/chat.json b/src/renderer/src/i18n/ru-RU/chat.json index a88492158..66e65b93f 100644 --- a/src/renderer/src/i18n/ru-RU/chat.json +++ b/src/renderer/src/i18n/ru-RU/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "Ещё {seconds} секунд ожидания, интервал {interval} секунд" }, "features": { - "deepThinking": "Глубокое мышление", "webSearch": "Поиск в интернете", - "deepThinkingProgress": "Глубокое мышление...", - "thinkingDuration": "(Заняло {0} секунд)", - "artifactThinking": "Артефакт мышление" + "artifactThinking": "Артефакт мышление", + "thoughtForSeconds": "Мышление {seconds} секунд", + "thoughtForSecondsLoading": "Мышление ({seconds} секунд)" }, "search": { "results": "Найдено {0} веб-страниц", diff --git a/src/renderer/src/i18n/zh-CN/chat.json b/src/renderer/src/i18n/zh-CN/chat.json index 669ab539d..6ec8b5b07 100644 --- a/src/renderer/src/i18n/zh-CN/chat.json +++ b/src/renderer/src/i18n/zh-CN/chat.json @@ -19,10 +19,9 @@ "rateLimitWaitingTooltip": "还需等待 {seconds} 秒,间隔 {interval} 秒" }, "features": { - "deepThinking": "深度思考", "webSearch": "联网搜索", - "deepThinkingProgress": "深度思考中...", - "thinkingDuration": "(用时 {0} 秒)", + "thoughtForSeconds": "思考了 {seconds} 秒", + "thoughtForSecondsLoading": "正在思考(第 {seconds} 秒)", "artifactThinking": "artifact 思考" }, "search": { diff --git a/src/renderer/src/i18n/zh-HK/chat.json b/src/renderer/src/i18n/zh-HK/chat.json index 760828935..e8b218c03 100644 --- a/src/renderer/src/i18n/zh-HK/chat.json +++ b/src/renderer/src/i18n/zh-HK/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "還需等待 {seconds} 秒,間隔 {interval} 秒" }, "features": { - "deepThinking": "深度思考", "webSearch": "網絡搜索", - "deepThinkingProgress": "深度思考中...", - "thinkingDuration": "(用時 {0} 秒)", - "artifactThinking": "artifact 思考" + "artifactThinking": "artifact 思考", + "thoughtForSeconds": "思考了 {seconds} 秒", + "thoughtForSecondsLoading": "正在思考(第 {seconds} 秒)" }, "search": { "results": "已搜索到{0}個網頁", diff --git a/src/renderer/src/i18n/zh-TW/chat.json b/src/renderer/src/i18n/zh-TW/chat.json index 903aabe18..df5bb4bd8 100644 --- a/src/renderer/src/i18n/zh-TW/chat.json +++ b/src/renderer/src/i18n/zh-TW/chat.json @@ -19,11 +19,10 @@ "rateLimitWaitingTooltip": "還需等待 {seconds} 秒,間隔 {interval} 秒" }, "features": { - "deepThinking": "深度思考", "webSearch": "網路搜尋", - "deepThinkingProgress": "深度思考中...", - "thinkingDuration": "(耗時 {0} 秒)", - "artifactThinking": "Artifact 思考" + "artifactThinking": "Artifact 思考", + "thoughtForSeconds": "思考了 {seconds} 秒", + "thoughtForSecondsLoading": "正在思考(第 {seconds} 秒)" }, "search": { "results": "已搜尋到 {0} 個網頁", diff --git a/src/renderer/src/views/PlaygroundTabView.vue b/src/renderer/src/views/PlaygroundTabView.vue index 06d4192d5..0c18eca4b 100644 --- a/src/renderer/src/views/PlaygroundTabView.vue +++ b/src/renderer/src/views/PlaygroundTabView.vue @@ -42,6 +42,7 @@ import DialogDemo from './playground/demos/DialogDemo.vue' import TabsDemo from './playground/demos/TabsDemo.vue' import AccordionDemo from './playground/demos/AccordionDemo.vue' import FormDemo from './playground/demos/FormDemo.vue' +import ThinkContentDemo from './playground/demos/ThinkContentDemo.vue' import CardDemo from './playground/demos/CardDemo.vue' import SelectDemo from './playground/demos/SelectDemo.vue' @@ -112,6 +113,12 @@ const sections = computed(() => [ description: 'Card layout with header, content, and footer.', componentName: '@shadcn/components/ui/card', render: CardDemo + }, + { + title: 'Think Content', + description: 'Collapsible reasoning block used for model thoughts.', + componentName: '@/components/think-content', + render: ThinkContentDemo } ] }, diff --git a/src/renderer/src/views/playground/demos/ThinkContentDemo.vue b/src/renderer/src/views/playground/demos/ThinkContentDemo.vue new file mode 100644 index 000000000..7acd5a0c5 --- /dev/null +++ b/src/renderer/src/views/playground/demos/ThinkContentDemo.vue @@ -0,0 +1,75 @@ + + + + + {{ expanded ? 'Collapse' : 'Expand' }} + + + {{ thinking ? 'Stop thinking' : 'Simulate thinking' }} + + Reset + + + + + + + diff --git a/src/types/i18n.d.ts b/src/types/i18n.d.ts index e3a6ee79e..482bec59a 100644 --- a/src/types/i18n.d.ts +++ b/src/types/i18n.d.ts @@ -72,10 +72,9 @@ declare module 'vue-i18n' { historyPlaceholder: string } features: { - deepThinking: string webSearch: string - deepThinkingProgress: string - thinkingDuration: string + thoughtForSeconds: string + thoughtForSecondsLoading: string artifactThinking: string } search: {