From d207e200ead8466553898ca2f38e8627cb466fc7 Mon Sep 17 00:00:00 2001 From: Paul Jankowski <8BitTitan@gmail.com> Date: Wed, 26 Aug 2026 16:13:05 -0400 Subject: [PATCH] Update en based Algolia docs page --- docs/en/reference/default-theme-search.md | 32 +++++++------ docs/snippets/algolia-i18n.ts | 57 +++++++++++++++++++++-- 2 files changed, 69 insertions(+), 20 deletions(-) diff --git a/docs/en/reference/default-theme-search.md b/docs/en/reference/default-theme-search.md index d383288e..e2f50a8d 100644 --- a/docs/en/reference/default-theme-search.md +++ b/docs/en/reference/default-theme-search.md @@ -204,7 +204,7 @@ export default defineConfig({ options: { appId: '...', apiKey: '...', - indexName: '...' + indices: ['...'] } } } @@ -222,10 +222,14 @@ You can use a config like this to use multilingual search: -Refer [official Algolia docs](https://docsearch.algolia.com/docs/api#translations) to learn more about them. To quickly get started, you can also copy the translations used by this site from [our GitHub repo](https://github.com/search?q=repo:vuejs/vitepress+%22function+searchOptions%22&type=code). +Refer [official Algolia docs](https://docsearch.algolia.com/docs/packages/react/api-reference#translations) to learn more about them. To quickly get started, you can also copy the translations used by this site from [our GitHub repo](https://github.com/search?q=repo:vuejs/vitepress+%22function+searchOptions%22&type=code). ### Algolia Ask AI Support {#ask-ai} +::: note Note +As of `v5.0.0`, Ask AI has now moved to using Algolia's [Agent Studio](https://www.algolia.com/doc/guides/algolia-ai/agent-studio/how-to/quickstart) as it's backend. There is an Ask AI -> Agent Studio [migration guide](https://docsearch.algolia.com/docs/agent-studio/migrate-to-agent-studio) available to help with the transition. +::: + If you would like to include **Ask AI**, pass the `askAi` option (or any of the partial fields) inside `options`: ```ts @@ -238,16 +242,15 @@ export default defineConfig({ options: { appId: '...', apiKey: '...', - indexName: '...', - // askAi: "YOUR-ASSISTANT-ID" + indices: ['...'], + // askAi: "YOUR-AGENT-ID" // OR askAi: { - // at minimum you must provide the assistantId you received from Algolia - assistantId: 'XXXYYY', - // optional overrides – if omitted, the top-level appId/apiKey/indexName values are reused + // at minimum you must provide the agentId you received from Algolia + agentId: 'XXXYYY', + // optional overrides – if omitted, the top-level appId/apiKey values are reused // apiKey: '...', // appId: '...', - // indexName: '...' } } } @@ -261,7 +264,7 @@ If you want to default to keyword search and do not want to use Ask AI, omit the ### Ask AI Side Panel {#ask-ai-side-panel} -DocSearch v4.5+ supports an optional **Ask AI side panel**. When enabled, it can be opened with **Ctrl/Cmd+I** by default. The [Sidepanel API Reference](https://docsearch.algolia.com/docs/sidepanel/api-reference) contains the full list of options. +DocSearch v4.5+ supports an optional **Ask AI side panel**. When enabled, it can be opened with **Ctrl/Cmd+I** by default. The [Sidepanel API Reference](https://docsearch.algolia.com/docs/packages/sidepanel/api) contains the full list of options. ```ts import { defineConfig } from 'vitepress' @@ -273,9 +276,9 @@ export default defineConfig({ options: { appId: '...', apiKey: '...', - indexName: '...', + indices: ['...'], askAi: { - assistantId: 'XXXYYY', + agentId: 'XXXYYY', sidePanel: { panel: { variant: 'floating', // or 'inline' @@ -310,9 +313,9 @@ export default defineConfig({ options: { appId: '...', apiKey: '...', - indexName: '...', + indices: ['...'], askAi: { - assistantId: 'XXXYYY', + agentId: 'XXXYYY', sidePanel: { keyboardShortcuts: { 'Ctrl/Cmd+I': false @@ -348,10 +351,9 @@ export default defineConfig({ options: { mode: 'sidePanel', askAi: { - assistantId: 'XXXYYY', + agentId: 'XXXYYY', appId: '...', apiKey: '...', - indexName: '...', sidePanel: true } } diff --git a/docs/snippets/algolia-i18n.ts b/docs/snippets/algolia-i18n.ts index 0dfa5107..cd8f1603 100644 --- a/docs/snippets/algolia-i18n.ts +++ b/docs/snippets/algolia-i18n.ts @@ -7,7 +7,7 @@ export default defineConfig({ options: { appId: '...', apiKey: '...', - indexName: '...', + indices: ['...'], locales: { zh: { translations: { @@ -33,6 +33,14 @@ export default defineConfig({ viewConversationHistoryText: '对话历史', threadDepthErrorPlaceholder: '对话已达上限' }, + facets: { + defaultValueLabel: '全部', + facetMenuTriggerAriaLabel: '已选择', + clearAllLabel: '清除全部', + facetsAriaLabel: '搜索筛选条件', + selectedFacetsAriaLabel: '已选择的搜索筛选条件', + clearFacetAriaLabel: '清除筛选条件:' + }, newConversation: { newConversationTitle: '我今天能帮你什么?', newConversationDescription: @@ -72,7 +80,11 @@ export default defineConfig({ }, resultsScreen: { askAiPlaceholder: '询问 AI:', - noResultsAskAiPlaceholder: '文档里没找到?让 Ask AI 帮忙:' + noResultsAskAiPlaceholder: '文档里没找到?让 Ask AI 帮忙:', + resultsSectionTitle: '搜索结果', + askAiResultsTitle: '询问 AI 助手', + recentConversationTimestampFallback: '不久前', + resultBadgeLabelText: '类别' }, askAiScreen: { disclaimerText: '回答由 AI 生成,可能会出错。请核实。', @@ -89,7 +101,24 @@ export default defineConfig({ afterToolCallText: '已搜索', stoppedStreamingText: '你已停止此回复', errorTitleText: '聊天错误', - startNewConversationButtonText: '开始新的对话' + startNewConversationButtonText: '开始新的对话', + relatedSourcesTextPlural: '相关来源', + savedMemoryToolResultText: '已保存到记忆', + memoryToolResultText: '已使用记忆增强结果', + feedbackPanelTitle: '哪里出了问题?(可选)', + feedbackDetailsPlaceholder: '请分享更多细节...', + feedbackDisclaimerText: '反馈中将包含此对话的副本。', + feedbackSubmitButtonText: '提交', + feedbackCloseButtonTitle: '关闭', + feedbackTagIncorrect: '不正确或不完整', + feedbackTagNotWhatIAsked: '不是我想问的', + feedbackTagSlowOrBuggy: '响应缓慢或存在故障', + feedbackTagStyleOrTone: '风格或语气', + feedbackTagSafetyOrLegal: '安全或法律问题', + feedbackTagOther: '其他', + threadDepthExceededMessage: + '为确保回答准确,此对话现已关闭。', + suggestedPromptsTitleText: '推荐问题' } } }, @@ -115,7 +144,10 @@ export default defineConfig({ promptAskAnotherQuestionText: '再问一个问题', promptDisclaimerText: '回答由 AI 生成,可能会出错。', promptLabelText: '按回车发送,Shift+回车换行。', - promptAriaLabelText: '问题输入' + promptAriaLabelText: '问题输入', + startNewConversationButtonText: '开始新的对话', + blockingErrorContinueText: '以继续。', + blockingErrorFallbackText: '此对话无法继续。' }, conversationScreen: { preToolCallText: '搜索中...', @@ -132,7 +164,22 @@ export default defineConfig({ likeButtonTitle: '喜欢', dislikeButtonTitle: '不喜欢', thanksForFeedbackText: '感谢你的反馈!', - errorTitleText: '聊天错误' + errorTitleText: '聊天错误', + relatedSourcesTextPlural: '相关来源', + savedMemoryToolResultText: '已保存到记忆', + memoryToolResultText: '已使用记忆增强结果', + feedbackPanelTitle: '哪里出了问题?(可选)', + feedbackDetailsPlaceholder: '请分享更多细节...', + feedbackDisclaimerText: '反馈中将包含此对话的副本。', + feedbackSubmitButtonText: '提交', + feedbackCloseButtonTitle: '关闭', + feedbackTagIncorrect: '不正确或不完整', + feedbackTagNotWhatIAsked: '不是我想问的', + feedbackTagSlowOrBuggy: '响应缓慢或存在故障', + feedbackTagStyleOrTone: '风格或语气', + feedbackTagSafetyOrLegal: '安全或法律问题', + feedbackTagOther: '其他', + suggestedPromptsTitleText: '推荐问题' }, newConversationScreen: { titleText: '我今天能帮你什么?',