diff --git a/x-pack/plugins/observability_ai_assistant/server/service/index.ts b/x-pack/plugins/observability_ai_assistant/server/service/index.ts index 7a268fb7eb3d7..ab37c59563713 100644 --- a/x-pack/plugins/observability_ai_assistant/server/service/index.ts +++ b/x-pack/plugins/observability_ai_assistant/server/service/index.ts @@ -25,6 +25,8 @@ function getResourceName(resource: string) { return `.kibana-observability-ai-assistant-${resource}`; } +export const ELSER_MODEL_ID = '.elser_model_2'; + export const INDEX_QUEUED_DOCUMENTS_TASK_ID = 'observabilityAIAssistant:indexQueuedDocumentsTask'; export const INDEX_QUEUED_DOCUMENTS_TASK_TYPE = INDEX_QUEUED_DOCUMENTS_TASK_ID + 'Type'; @@ -120,6 +122,11 @@ export class ObservabilityAIAssistantService { auto_expand_replicas: '0-1', hidden: true, }, + mappings: { + _meta: { + model: ELSER_MODEL_ID, + }, + }, }, }); @@ -150,7 +157,7 @@ export class ObservabilityAIAssistantService { processors: [ { inference: { - model_id: '.elser_model_1', + model_id: ELSER_MODEL_ID, target_field: 'ml', field_map: { text: 'text_field', diff --git a/x-pack/plugins/observability_ai_assistant/server/service/kb_service/index.ts b/x-pack/plugins/observability_ai_assistant/server/service/kb_service/index.ts index be10c3eaaa5d5..e5a92b3467768 100644 --- a/x-pack/plugins/observability_ai_assistant/server/service/kb_service/index.ts +++ b/x-pack/plugins/observability_ai_assistant/server/service/kb_service/index.ts @@ -13,7 +13,11 @@ import type { TaskManagerStartContract } from '@kbn/task-manager-plugin/server'; import pLimit from 'p-limit'; import pRetry from 'p-retry'; import { map } from 'lodash'; -import { INDEX_QUEUED_DOCUMENTS_TASK_ID, INDEX_QUEUED_DOCUMENTS_TASK_TYPE } from '..'; +import { + ELSER_MODEL_ID, + INDEX_QUEUED_DOCUMENTS_TASK_ID, + INDEX_QUEUED_DOCUMENTS_TASK_TYPE, +} from '..'; import type { KnowledgeBaseEntry } from '../../../common/types'; import type { ObservabilityAIAssistantResourceNames } from '../types'; import { getAccessQuery } from '../util/get_access_query'; @@ -42,8 +46,6 @@ function isAlreadyExistsError(error: Error) { ); } -const ELSER_MODEL_ID = '.elser_model_1'; - function throwKnowledgeBaseNotReady(body: any) { throw serverUnavailable(`Knowledge base is not ready yet`, body); } @@ -199,7 +201,7 @@ export class KnowledgeBaseService { text_expansion: { 'ml.tokens': { model_text: text, - model_id: '.elser_model_1', + model_id: ELSER_MODEL_ID, }, } as unknown as QueryDslTextExpansionQuery, })),