refactor: move general utils to shared directory

This commit is contained in:
AnotiaWang
2025-03-23 14:55:19 +08:00
parent ff1e79603d
commit 60f6f227c3
11 changed files with 124 additions and 63 deletions

View File

@ -272,6 +272,7 @@
retryNode,
currentDepth,
breadth,
aiConfig: config.ai,
maxDepth: form.value.depth,
languageCode: locale.value,
searchLanguageCode: config.webSearch.searchLanguage,

View File

@ -1,9 +1,6 @@
<script setup lang="ts">
const { locale: globalLocale, availableLocales, t, setLocale } = useI18n()
export type Locale = (typeof globalLocale)['value']
export type AvailableLocales = Locale[]
const props = defineProps<{
/** Override display locale */
value?: Locale

View File

@ -19,7 +19,7 @@
}>()
const { t, locale } = useI18n()
const { showConfigManager, isConfigValid } = storeToRefs(useConfigStore())
const { showConfigManager, isConfigValid, config } = storeToRefs(useConfigStore())
const toast = useToast()
const reasoningContent = ref('')
@ -57,6 +57,7 @@
query: form.value.query,
numQuestions: form.value.numQuestions,
language: t('language', {}, { locale: locale.value }),
aiConfig: config.value.ai,
})) {
if (f.type === 'reasoning') {
reasoningContent.value += f.delta

View File

@ -8,6 +8,7 @@
} from '~/constants/injection-keys'
const { t, locale } = useI18n()
const { config } = storeToRefs(useConfigStore())
const toast = useToast()
const error = ref('')
@ -156,6 +157,7 @@
prompt: getCombinedQuery(form.value, feedback.value),
language: t('language', {}, { locale: locale.value }),
learnings,
aiConfig: config.value.ai,
})
for await (const chunk of fullStream) {
if (chunk.type === 'reasoning') {