diff --git a/assistant/widget.mdx b/assistant/widget.mdx index 905d59213..b352afbc2 100644 --- a/assistant/widget.mdx +++ b/assistant/widget.mdx @@ -132,6 +132,35 @@ Changing `identity` starts a new conversation. Changing the widget ID or API end You can supply `supportEmail` and `starterQuestions` during initialization and change them later with `update()`. These values apply to the current embed and do not inherit from your Mintlify dashboard. +## Scope retrieval by language or version + +Use `filter` to restrict what the assistant retrieves when your docs are organized by language or [versions](/organize/navigation#versions). Omit a field to search across every value for it. + +```js +await window.MintlifyAssistant.init({ + id: "YOUR_WIDGET_ID", + filter: { + language: "en", + version: "v2", + }, +}); +``` + +`language` must be a [supported language code](/organize/settings-reference#navigation-global-languages), such as `en`, `es`, `fr`, or `zh-Hans`. `version` matches the version name configured in your dashboard. + +Change filters at runtime with `update()` when the visitor switches language or version in your application: + +```js +await window.MintlifyAssistant.update({ + filter: { + language: "fr", + version: null, + }, +}); +``` + +Pass `null` on a field to clear that filter, or `filter: null` to clear both. + ## Configuration reference ### `AssistantConfig` @@ -149,6 +178,7 @@ Pass this object to `init()`. | `labels` | [`AssistantLabels`](#assistantlabels) | Customer-facing text overrides. | | `supportEmail` | string | Sets the support address shown in the widget toolbar for this embed. | | `starterQuestions` | string[] | Sets up to three empty-state prompts for this embed. | +| `filter` | [`AssistantFilter`](#assistantfilter) | Restricts retrieval to a docs language and version. | | `hooks` | [`AssistantHooks`](#assistanthooks) | Event and error observers. | ### `AssistantAppearance` @@ -168,6 +198,13 @@ Pass this object to `init()`. Arbitrary CSS and neutral-palette overrides are not supported. The closed Shadow DOM protects both your application and the widget from cross-site style regressions. +### `AssistantFilter` + +| Option | Type | Description | +| ---------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| `language` | string or `null` | Restricts retrieval to a [supported language code](/organize/settings-reference#navigation-global-languages), such as `en`. Omit to search all languages. | +| `version` | string or `null` | Restricts retrieval to a docs version, such as `v2`. Omit to search all versions. | + ### `AssistantLabels` | Option | Values | Description | @@ -225,6 +262,7 @@ Pass this object to `update()`. Every field is optional, and `null` restores its | `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Deep-patches customer-facing text. | | `supportEmail` | string or `null` | Changes the support address. Pass `null` to remove it. | | `starterQuestions` | string[] or `null` | Changes up to three prompts. Pass `null` to restore an empty list. | +| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Deep-patches retrieval filters. Pass `null` to clear all filters. | | `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Deep-patches event and error observers. | ## Browser API diff --git a/es/assistant/widget.mdx b/es/assistant/widget.mdx index fb090eaa3..180b68ba5 100644 --- a/es/assistant/widget.mdx +++ b/es/assistant/widget.mdx @@ -144,6 +144,37 @@ Cambiar `identity` inicia una nueva conversación. Cambiar el ID del widget o el Puedes proporcionar `supportEmail` y `starterQuestions` durante la inicialización y cambiarlos más tarde con `update()`. Estos valores se aplican al embed actual y no se heredan desde tu panel de Mintlify. +
+ ## Delimitar la recuperación por idioma o versión +
+ +Usa `filter` para restringir lo que el asistente recupera cuando tu documentación está organizada por idioma o [versiones](/es/organize/navigation#versions). Omite un campo para buscar en todos sus valores. + +```js +await window.MintlifyAssistant.init({ + id: "YOUR_WIDGET_ID", + filter: { + language: "en", + version: "v2", + }, +}); +``` + +`language` debe ser un [código de idioma admitido](/es/organize/settings-reference#navigation-global-languages), como `en`, `es`, `fr` o `zh-Hans`. `version` coincide con el nombre de la versión configurada en tu panel. + +Cambia los filtros en tiempo de ejecución con `update()` cuando el visitante cambie de idioma o versión en tu aplicación: + +```js +await window.MintlifyAssistant.update({ + filter: { + language: "fr", + version: null, + }, +}); +``` + +Pasa `null` en un campo para borrar ese filtro, o `filter: null` para borrar ambos. +
## Referencia de configuración
@@ -165,6 +196,7 @@ Pasa este objeto a `init()`. | `labels` | [`AssistantLabels`](#assistantlabels) | Sobrescrituras de texto orientado al cliente. | | `supportEmail` | string | Establece la dirección de soporte que se muestra en la barra de herramientas del widget para este embed. | | `starterQuestions` | string[] | Establece hasta **tres** sugerencias de estado vacío para este embed. | +| `filter` | [`AssistantFilter`](#assistantfilter) | Restringe la recuperación a un idioma y versión de la documentación. | | `hooks` | [`AssistantHooks`](#assistanthooks) | Observadores de eventos y errores. |
@@ -186,6 +218,15 @@ Pasa este objeto a `init()`. No se admiten sobrescrituras arbitrarias de CSS ni de paleta neutra. El Shadow DOM cerrado protege tanto a tu aplicación como al widget de regresiones de estilos entre sitios. +
+ ### `AssistantFilter` +
+ +| Option | Type | Description | +| ---------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `language` | string or `null` | Restringe la recuperación a un [código de idioma admitido](/es/organize/settings-reference#navigation-global-languages), como `en`. Omítelo para buscar en todos los idiomas. | +| `version` | string or `null` | Restringe la recuperación a una versión de la documentación, como `v2`. Omítela para buscar en todas las versiones. | +
### `AssistantLabels`
@@ -253,6 +294,7 @@ Pasa este objeto a `update()`. Todos los campos son opcionales y `null` restaura | `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Aplica parches en profundidad al texto orientado al cliente. | | `supportEmail` | string or `null` | Cambia la dirección de soporte. Pasa `null` para eliminarla. | | `starterQuestions` | string[] or `null` | Cambia hasta tres sugerencias. Pasa `null` para restaurar una lista vacía. | +| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Aplica parches en profundidad a los filtros de recuperación. Pasa `null` para borrar todos los filtros. | | `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Aplica parches en profundidad a los observadores de eventos y errores. |
diff --git a/fr/assistant/widget.mdx b/fr/assistant/widget.mdx index 8171111ad..ee0d9aaaa 100644 --- a/fr/assistant/widget.mdx +++ b/fr/assistant/widget.mdx @@ -144,6 +144,37 @@ La modification de `identity` démarre une nouvelle conversation. La modificatio Vous pouvez fournir `supportEmail` et `starterQuestions` lors de l'initialisation et les modifier ultérieurement avec `update()`. Ces valeurs s'appliquent à l'intégration en cours et ne sont pas héritées de votre tableau de bord Mintlify. +
+ ## Restreindre la recherche par langue ou version +
+ +Utilisez `filter` pour restreindre ce que l'assistant récupère lorsque votre documentation est organisée par langue ou par [versions](/fr/organize/navigation#versions). Omettez un champ pour rechercher dans toutes ses valeurs. + +```js +await window.MintlifyAssistant.init({ + id: "YOUR_WIDGET_ID", + filter: { + language: "en", + version: "v2", + }, +}); +``` + +`language` doit être un [code de langue pris en charge](/fr/organize/settings-reference#navigation-global-languages), tel que `en`, `es`, `fr` ou `zh-Hans`. `version` correspond au nom de la version configurée dans votre tableau de bord. + +Modifiez les filtres au moment de l'exécution avec `update()` lorsque le visiteur change de langue ou de version dans votre application : + +```js +await window.MintlifyAssistant.update({ + filter: { + language: "fr", + version: null, + }, +}); +``` + +Passez `null` sur un champ pour effacer ce filtre, ou `filter: null` pour effacer les deux. +
## Référence de configuration
@@ -165,6 +196,7 @@ Passez cet objet à `init()`. | `labels` | [`AssistantLabels`](#assistantlabels) | Substitutions du texte visible par le client. | | `supportEmail` | string | Définit l'adresse d'assistance affichée dans la barre d'outils du widget pour cette intégration. | | `starterQuestions` | string[] | Définit jusqu'à **trois** invites d'état vide pour cette intégration. | +| `filter` | [`AssistantFilter`](#assistantfilter) | Restreint la recherche à une langue et à une version de la documentation. | | `hooks` | [`AssistantHooks`](#assistanthooks) | Observateurs d'événements et d'erreurs. |
@@ -186,6 +218,15 @@ Passez cet objet à `init()`. Les substitutions CSS arbitraires et les palettes neutres ne sont pas prises en charge. Le Shadow DOM fermé protège à la fois votre application et le widget des régressions de style entre sites. +
+ ### `AssistantFilter` +
+ +| Option | Type | Description | +| ---------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `language` | string or `null` | Restreint la recherche à un [code de langue pris en charge](/fr/organize/settings-reference#navigation-global-languages), tel que `en`. Omettez pour rechercher dans toutes les langues. | +| `version` | string or `null` | Restreint la recherche à une version de la documentation, telle que `v2`. Omettez pour rechercher dans toutes les versions. | +
### `AssistantLabels`
@@ -253,6 +294,7 @@ Passez cet objet à `update()`. Chaque champ est facultatif, et `null` restaure | `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Applique un patch profond au texte visible par le client. | | `supportEmail` | string or `null` | Change l'adresse d'assistance. Passez `null` pour la supprimer. | | `starterQuestions` | string[] or `null` | Change jusqu'à trois invites. Passez `null` pour restaurer une liste vide. | +| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Applique un patch en profondeur aux filtres de recherche. Passez `null` pour effacer tous les filtres. | | `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Applique un patch profond aux observateurs d'événements et d'erreurs. |
diff --git a/zh/assistant/widget.mdx b/zh/assistant/widget.mdx index 9fdc55bec..ea228b89f 100644 --- a/zh/assistant/widget.mdx +++ b/zh/assistant/widget.mdx @@ -144,6 +144,37 @@ await window.MintlifyAssistant.update({ 你可以在初始化时提供 `supportEmail` 和 `starterQuestions`,也可以稍后通过 `update()` 更改。这些值仅作用于当前嵌入,不会继承自你的 Mintlify 仪表板。 +
+ ## 按语言或版本限定检索范围 +
+ +当你的文档按语言或[版本](/zh/organize/navigation#versions)组织时,使用 `filter` 来限定助手检索的范围。省略某个字段即可对该字段的所有取值进行检索。 + +```js +await window.MintlifyAssistant.init({ + id: "YOUR_WIDGET_ID", + filter: { + language: "en", + version: "v2", + }, +}); +``` + +`language` 必须是[受支持的语言代码](/zh/organize/settings-reference#navigation-global-languages),例如 `en`、`es`、`fr` 或 `zh-Hans`。`version` 与你在仪表板中配置的版本名称一致。 + +当访客在你的应用中切换语言或版本时,可通过 `update()` 在运行时更改筛选条件: + +```js +await window.MintlifyAssistant.update({ + filter: { + language: "fr", + version: null, + }, +}); +``` + +对某个字段传入 `null` 可清除该筛选条件,传入 `filter: null` 可同时清除两个筛选条件。 +
## 配置参考
@@ -165,6 +196,7 @@ await window.MintlifyAssistant.update({ | `labels` | [`AssistantLabels`](#assistantlabels) | 面向客户的文案覆盖设置。 | | `supportEmail` | string | 设置该嵌入在小组件工具栏中显示的支持邮箱。 | | `starterQuestions` | string[] | 为该嵌入设置最多 **三** 条空状态提示。 | +| `filter` | [`AssistantFilter`](#assistantfilter) | 将检索限定到指定的文档语言和版本。 | | `hooks` | [`AssistantHooks`](#assistanthooks) | 事件和错误观察者。 |
@@ -186,6 +218,15 @@ await window.MintlifyAssistant.update({ 不支持任意 CSS 和中性色板覆盖。封闭的 Shadow DOM 可同时保护你的应用与小组件,防止跨站样式回归。 +
+ ### `AssistantFilter` +
+ +| Option | Type | Description | +| ---------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `language` | string or `null` | 将检索限定到[受支持的语言代码](/zh/organize/settings-reference#navigation-global-languages),例如 `en`。省略以在所有语言中检索。 | +| `version` | string or `null` | 将检索限定到指定的文档版本,例如 `v2`。省略以在所有版本中检索。 | +
### `AssistantLabels`
@@ -253,6 +294,7 @@ hooks: { | `labels` | [`AssistantLabels`](#assistantlabels) or `null` | 深度合并面向客户的文案。 | | `supportEmail` | string or `null` | 更改支持邮箱。传入 `null` 可移除。 | | `starterQuestions` | string[] or `null` | 更改最多三条提示。传入 `null` 可恢复为空列表。 | +| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | 深度合并检索筛选条件。传入 `null` 可清除所有筛选条件。 | | `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | 深度合并事件和错误观察者。 |