Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"@kbn/ai-assistant-common": "link:x-pack/platform/packages/shared/ai-assistant/common",
"@kbn/ai-assistant-connector-selector-action": "link:x-pack/platform/packages/shared/ai-assistant/ai-assistant-connector-selector-action",
"@kbn/ai-assistant-cta": "link:x-pack/platform/packages/shared/ai-assistant/ai-assistant-cta",
"@kbn/ai-assistant-default-llm-setting": "link:x-pack/platform/packages/shared/ai-assistant-default-llm-setting",
"@kbn/ai-assistant-icon": "link:x-pack/platform/packages/shared/ai-assistant/icon",
"@kbn/ai-assistant-management-plugin": "link:src/platform/plugins/shared/ai_assistant_management/selection",
"@kbn/ai-security-labs-content": "link:x-pack/solutions/security/packages/ai-security-labs-content",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ export const OBSERVABILITY_AI_ASSISTANT_SIMULATED_FUNCTION_CALLING =
'observability:aiAssistantSimulatedFunctionCalling';
export const OBSERVABILITY_AI_ASSISTANT_SEARCH_CONNECTOR_INDEX_PATTERN =
'observability:aiAssistantSearchConnectorIndexPattern';
export const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR = 'genAiSettings:defaultAIConnector';
export const GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY =
'genAiSettings:defaultAIConnectorOnly';
export const OBSERVABILITY_SEARCH_EXCLUDED_DATA_TIERS = 'observability:searchExcludedDataTiers';
export const OBSERVABILITY_ENABLE_DIAGNOSTIC_MODE = 'observability:enableDiagnosticMode';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,18 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
type: 'boolean',
_meta: { description: 'Non-default value of setting.' },
},
'genAiSettings:defaultAIConnector': {
type: 'keyword',
_meta: {
description: 'Default AI connector',
},
},
'genAiSettings:defaultAIConnectorOnly': {
type: 'boolean',
_meta: {
description: 'Restrict to default AI connector only',
},
},
'observability:searchExcludedDataTiers': {
type: 'array',
items: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ export interface UsageStats {
'devTools:enablePersistentConsole': boolean;
'aiAssistant:preferredAIAssistantType': string;
'observability:profilingFetchTopNFunctionsFromStacktraces': boolean;
'genAiSettings:defaultAIConnector': string;
'genAiSettings:defaultAIConnectorOnly': boolean;
'securitySolution:excludedDataTiersForRuleExecution': string[];
'securitySolution:maxUnassociatedNotes': number;
'observability:searchExcludedDataTiers': string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export const NO_DEFAULT_CONNECTOR = 'NO_DEFAULT_CONNECTOR';
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {
Plugin,
DEFAULT_APP_CATEGORIES,
} from '@kbn/core/server';
import {
GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR,
GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY,
} from '@kbn/management-settings-ids';
import { schema } from '@kbn/config-schema';
import type { AIAssistantManagementSelectionConfig } from './config';
import type {
Expand All @@ -24,6 +28,7 @@ import type {
AIAssistantManagementSelectionPluginServerSetup,
AIAssistantManagementSelectionPluginServerStart,
} from './types';
import { NO_DEFAULT_CONNECTOR } from '../common/constants';
import { AIAssistantType } from '../common/ai_assistant_type';
import { PREFERRED_AI_ASSISTANT_TYPE_SETTING_KEY } from '../common/ui_setting_keys';

Expand Down Expand Up @@ -92,6 +97,24 @@ export class AIAssistantManagementSelectionPlugin
},
});

core.uiSettings.register({
[GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR]: {
readonlyMode: 'ui',
readonly: false,
schema: schema.string(),
value: NO_DEFAULT_CONNECTOR,
},
});

core.uiSettings.register({
[GEN_AI_SETTINGS_DEFAULT_AI_CONNECTOR_DEFAULT_ONLY]: {
readonlyMode: 'ui',
readonly: false,
schema: schema.boolean(),
value: false,
},
});

core.capabilities.registerProvider(() => {
return {
management: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@kbn/features-plugin",
"@kbn/config",
"@kbn/doc-links",
"@kbn/licensing-plugin"
"@kbn/licensing-plugin",
"@kbn/management-settings-ids"
],
"exclude": ["target/**/*"]
}
12 changes: 12 additions & 0 deletions src/platform/plugins/shared/telemetry/schema/oss_platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -11434,6 +11434,18 @@
"description": "Non-default value of setting."
}
},
"genAiSettings:defaultAIConnector": {
"type": "keyword",
"_meta": {
"description": "Default AI connector"
}
},
"genAiSettings:defaultAIConnectorOnly": {
"type": "boolean",
"_meta": {
"description": "Restrict to default AI connector only"
}
},
"observability:searchExcludedDataTiers": {
"type": "array",
"items": {
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"@kbn/ai-assistant-connector-selector-action/*": ["x-pack/platform/packages/shared/ai-assistant/ai-assistant-connector-selector-action/*"],
"@kbn/ai-assistant-cta": ["x-pack/platform/packages/shared/ai-assistant/ai-assistant-cta"],
"@kbn/ai-assistant-cta/*": ["x-pack/platform/packages/shared/ai-assistant/ai-assistant-cta/*"],
"@kbn/ai-assistant-default-llm-setting": ["x-pack/platform/packages/shared/ai-assistant-default-llm-setting"],
"@kbn/ai-assistant-default-llm-setting/*": ["x-pack/platform/packages/shared/ai-assistant-default-llm-setting/*"],
"@kbn/ai-assistant-icon": ["x-pack/platform/packages/shared/ai-assistant/icon"],
"@kbn/ai-assistant-icon/*": ["x-pack/platform/packages/shared/ai-assistant/icon/*"],
"@kbn/ai-assistant-management-plugin": ["src/platform/plugins/shared/ai_assistant_management/selection"],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/ai-assistant-default-llm-setting

UI components for setting to configure default LLM.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { DefaultAIConnector } from './src/components/default_ai_connector';
export {
DefaultAiConnectorSettingsContextProvider,
useDefaultAiConnectorSettingContext,
} from './src/context/default_ai_connector_context';
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

module.exports = {
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/packages/kbn_ai_assistant_src',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/platform/packages/shared/kbn-ai-assistant/src/**/*.{ts,tsx}',
'!<rootDir>/x-pack/platform/packages/shared/kbn-ai-assistant/src/*.test.{ts,tsx}',
],
preset: '@kbn/test',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/packages/shared/ai-assistant-default-llm-setting'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "shared-browser",
"id": "@kbn/ai-assistant-default-llm-setting",
"owner": ["@elastic/security-generative-ai"],
"group": "platform",
"visibility": "shared"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@kbn/ai-assistant-default-llm-setting",
"description": "Default LLM settings for AI Assistant",
"private": true,
"version": "1.0.0",
"license": "Elastic License 2.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

// eslint-disable-next-line import/no-extraneous-dependencies
import '@testing-library/jest-dom';
Loading