Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Elastic AI Assistant] Refactors Knowledge Base fe…
…ature flag to UI feature toggle (#167935) ## Summary This PR refactors the `assistantLangChain` code feature flag introduced in #164908, to be a UI feature toggle that users can enable/disable via the `Knowledge Base` assistant advanced settings. Left image shows the feature disabled, and the right image shows the feature partly enabled. If ELSER is configured, the UI will attempt to install all resources automatically for a one-click UX, however if ELSER is not configured, or there are failures, the user can manually enable the Knowledge Base or ES|QL base documentation: <p align="center"> <img width="400" src="https://github.com/elastic/kibana/assets/2946766/be85522e-b2f5-4a39-9f0e-d359424caf37" /> <img width="400" src="https://github.com/elastic/kibana/assets/2946766/d901c4f8-2184-4fb7-8c59-f2ff877118b9" /> </p> Also, since this code feature flag was shared with the model evaluator experimental feature, a `modelEvaluatorEnabled` flag has been plumbed to fully decouple the two settings. Now _only the_ model evaluator is enabled when setting security Solution Advanced setting: ``` xpack.securitySolution.enableExperimental: ['assistantModelEvaluation'] ``` and the previous `assistantLangChain` code feature flag is now enabled by simply toggling on the Knowledge Base in the settings shown above. > [!NOTE] > Even if ELSER isn't configured, and the knowledge base/docs aren't setup, if the Knowledge Base is enabled, the LangChain code path will still be enabled as intended, but we can change this behavior if testing shows this is not ideal. ### Checklist Delete any items that are not applicable to this PR. - [X] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)added to match the most common scenarios - [X] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- Loading branch information