diff --git a/src/renderer/src/pages/home/Markdown/PlantUML.tsx b/src/renderer/src/pages/home/Markdown/PlantUML.tsx index aaf262ff..1bf97a11 100644 --- a/src/renderer/src/pages/home/Markdown/PlantUML.tsx +++ b/src/renderer/src/pages/home/Markdown/PlantUML.tsx @@ -136,9 +136,10 @@ const PlantUMLPopupCantaier: React.FC = ({ resolve, diagram png: false, svg: false }) + const [activeTab, setActiveTab] = useState('preview') const { t } = useTranslation() - console.log(`plantuml diagram: ${diagram}`) + const encodedDiagram = encodeDiagram(diagram) const onOk = () => { setOpen(false) diff --git a/src/renderer/src/pages/settings/WebSearchSettings.tsx b/src/renderer/src/pages/settings/WebSearchSettings.tsx index c01a5bcc..c95044b7 100644 --- a/src/renderer/src/pages/settings/WebSearchSettings.tsx +++ b/src/renderer/src/pages/settings/WebSearchSettings.tsx @@ -33,7 +33,6 @@ const WebSearchSettings: FC = () => { useEffect(() => { return () => { - console.log('apiKey', apiKey, provider.apiKey) if (apiKey && apiKey !== provider.apiKey) { updateProvider({ ...provider, apiKey }) } diff --git a/src/renderer/src/services/WebSearchService.ts b/src/renderer/src/services/WebSearchService.ts index 3ee8d32f..932fb3cf 100644 --- a/src/renderer/src/services/WebSearchService.ts +++ b/src/renderer/src/services/WebSearchService.ts @@ -25,14 +25,15 @@ class WebSearchService { public async search(query: string) { const searchWithTime = store.getState().websearch.searchWithTime - console.log('searchWithTime', searchWithTime) let formatted_query = query + if (searchWithTime) { formatted_query = `today is ${dayjs().format('YYYY-MM-DD')} \r\n ${query}` } - console.log('formatted_query', formatted_query) + const provider = this.getWebSearchProvider() const tvly = tavily({ apiKey: provider.apiKey }) + return await tvly.search(formatted_query, { maxResults: 5 }) diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index d07366f1..a8fb7436 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -32,7 +32,7 @@ const persistedReducer = persistReducer( { key: 'cherry-studio', storage, - version: 73, + version: 72, blacklist: ['runtime'], migrate }, diff --git a/src/renderer/src/store/migrate.ts b/src/renderer/src/store/migrate.ts index 2037e3d0..cc1d6345 100644 --- a/src/renderer/src/store/migrate.ts +++ b/src/renderer/src/store/migrate.ts @@ -1093,12 +1093,11 @@ const migrateConfig = { state.minapps.enabled.push(app) } }) + // remove zhihu-zhiada + state.minapps.enabled = state.minapps.enabled.filter((app) => app.id !== 'zhihu-zhiada') + state.minapps.disabled = state.minapps.disabled.filter((app) => app.id !== 'zhihu-zhiada') } - // remove zhihu-zhiada - state.minapps.enabled = state.minapps.enabled.filter((app) => app.id !== 'zhihu-zhiada') - state.minapps.disabled = state.minapps.disabled.filter((app) => app.id !== 'zhihu-zhiada') - state.settings.thoughtAutoCollapse = true return state @@ -1123,7 +1122,21 @@ const migrateConfig = { return state }, '73': (state: RootState) => { - state.websearch.searchWithTime = true + if (state.websearch) { + state.websearch.searchWithTime = true + } + if (!state.llm.providers.find((provider) => provider.id === 'lmstudio')) { + state.llm.providers.push({ + id: 'lmstudio', + name: 'LM Studio', + type: 'openai', + apiKey: '', + apiHost: 'http://localhost:1234', + models: SYSTEM_MODELS.lmstudio, + isSystem: true, + enabled: false + }) + } return state } } diff --git a/src/renderer/src/store/settings.ts b/src/renderer/src/store/settings.ts index 02bacdef..5728b27c 100644 --- a/src/renderer/src/store/settings.ts +++ b/src/renderer/src/store/settings.ts @@ -189,7 +189,6 @@ const settingsSlice = createSlice({ }, setWindowStyle: (state, action: PayloadAction<'transparent' | 'opaque'>) => { state.windowStyle = action.payload - console.log(state.windowStyle) }, setTopicPosition: (state, action: PayloadAction<'left' | 'right'>) => { state.topicPosition = action.payload