From 60f6f227c345b1135f4eca396c3573bb6828fe4b Mon Sep 17 00:00:00 2001 From: AnotiaWang Date: Sun, 23 Mar 2025 14:55:19 +0800 Subject: [PATCH] refactor: move general utils to `shared` directory --- app/components/DeepResearch/DeepResearch.vue | 1 + app/components/LangSwitcher.vue | 3 - app/components/ResearchFeedback.vue | 3 +- app/components/ResearchReport.vue | 2 + app/stores/config.ts | 22 +----- lib/deep-research.ts | 79 +++++++++++--------- lib/feedback.ts | 10 ++- shared/types/types.d.ts | 4 + shared/utils/ai-model.ts | 63 ++++++++++++++++ {utils => shared/utils}/errors.ts | 0 {utils => shared/utils}/json.ts | 0 11 files changed, 124 insertions(+), 63 deletions(-) create mode 100644 shared/types/types.d.ts create mode 100644 shared/utils/ai-model.ts rename {utils => shared/utils}/errors.ts (100%) rename {utils => shared/utils}/json.ts (100%) diff --git a/app/components/DeepResearch/DeepResearch.vue b/app/components/DeepResearch/DeepResearch.vue index 4cf8b2f..3b6adca 100644 --- a/app/components/DeepResearch/DeepResearch.vue +++ b/app/components/DeepResearch/DeepResearch.vue @@ -272,6 +272,7 @@ retryNode, currentDepth, breadth, + aiConfig: config.ai, maxDepth: form.value.depth, languageCode: locale.value, searchLanguageCode: config.webSearch.searchLanguage, diff --git a/app/components/LangSwitcher.vue b/app/components/LangSwitcher.vue index 21ffb23..f339c78 100644 --- a/app/components/LangSwitcher.vue +++ b/app/components/LangSwitcher.vue @@ -1,9 +1,6 @@