Skip to content

Commit

Permalink
[8.x] Remove `modelId` from config (#200181) (#200296)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `8.x`:
- [Remove `modelId` from config
(#200181)](#200181)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-15T05:58:20Z","message":"Remove
`modelId` from config (#200181)\n\nFollow up to
https://github.com/elastic/kibana/pull/186499\r\n\r\nThis removes
`modelId` from the config file. We don't need it anymore\r\nsince it can
be supplied as a url param. Currently it's only needed in\r\nthe setup
route (`POST
/internal/observability_ai_assistant/kb/setup`)","sha":"875313e751e70131185459533bd1bfae74efc32b","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:Obs
AI Assistant","ci:project-deploy-observability"],"title":"Remove
`modelId` from
config","number":200181,"url":"https://github.com/elastic/kibana/pull/200181","mergeCommit":{"message":"Remove
`modelId` from config (#200181)\n\nFollow up to
https://github.com/elastic/kibana/pull/186499\r\n\r\nThis removes
`modelId` from the config file. We don't need it anymore\r\nsince it can
be supplied as a url param. Currently it's only needed in\r\nthe setup
route (`POST
/internal/observability_ai_assistant/kb/setup`)","sha":"875313e751e70131185459533bd1bfae74efc32b"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200181","number":200181,"mergeCommit":{"message":"Remove
`modelId` from config (#200181)\n\nFollow up to
https://github.com/elastic/kibana/pull/186499\r\n\r\nThis removes
`modelId` from the config file. We don't need it anymore\r\nsince it can
be supplied as a url param. Currently it's only needed in\r\nthe setup
route (`POST
/internal/observability_ai_assistant/kb/setup`)","sha":"875313e751e70131185459533bd1bfae74efc32b"}}]}]
BACKPORT-->

Co-authored-by: Søren Louv-Jansen <[email protected]>
  • Loading branch information
kibanamachine and sorenlouv authored Nov 15, 2024
1 parent 6599679 commit 7a4bb76
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { schema, type TypeOf } from '@kbn/config-schema';

export const config = schema.object({
enabled: schema.boolean({ defaultValue: true }),
modelId: schema.maybe(schema.string()), // TODO: Remove
scope: schema.maybe(schema.oneOf([schema.literal('observability'), schema.literal('search')])),
enableKnowledgeBase: schema.boolean({ defaultValue: true }),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ export class ObservabilityAIAssistantPlugin

// Using once to make sure the same model ID is used during service init and Knowledge base setup
const getSearchConnectorModelId = once(async () => {
// TODO: Remove this once the modelId is removed from the config
const configModelId = this.config.modelId;
if (configModelId) {
return configModelId;
}
const defaultModelId = '.elser_model_2';
const [_, pluginsStart] = await core.getStartServices();
// Wait for the license to be available so the ML plugin's guards pass once we ask for ELSER stats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { mapValues } from 'lodash';
import path from 'path';
import { createTestConfig, CreateTestConfig } from '../common/config';
import { SUPPORTED_TRAINED_MODELS } from '../../functional/services/ml/api';

export const observabilityAIAssistantDebugLogger = {
name: 'plugins.observabilityAIAssistant',
Expand All @@ -31,7 +30,6 @@ export const observabilityAIAssistantFtrConfigs = {
__dirname,
'../../../../test/analytics/plugins/analytics_ftr_helpers'
),
'xpack.observabilityAIAssistant.modelId': SUPPORTED_TRAINED_MODELS.TINY_ELSER.name, // TODO: Remove
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 2.0.
*/

import { SUPPORTED_TRAINED_MODELS } from '@kbn/test-suites-xpack/functional/services/ml/api';
import { createTestConfig } from '../../../config.base';
import { ObservabilityAIAssistantServices } from './common/ftr_provider_context';
import { services as inheritedServices } from '../../../services';
Expand All @@ -28,7 +27,4 @@ export default createTestConfig({
// include settings from project controller
// https://github.com/elastic/project-controller/blob/main/internal/project/observability/config/elasticsearch.yml
esServerArgs: ['xpack.ml.dfa.enabled=false'],
kbnServerArgs: [
`--xpack.observabilityAIAssistant.modelId=${SUPPORTED_TRAINED_MODELS.TINY_ELSER.name}`, // TODO: Remove
],
});

0 comments on commit 7a4bb76

Please sign in to comment.