Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LLM tasks] Add product documentation retrieval task #194379

Merged
merged 113 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
76e3984
Create knowledge base registry plugin
pgayvallet Sep 30, 2024
89e033c
run bootstrap
pgayvallet Sep 30, 2024
b3c67ee
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Sep 30, 2024
3dc368e
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Sep 30, 2024
54430dd
Add knowledge_base_entry SO type
pgayvallet Sep 30, 2024
7694e75
make this empty plugin work, maybe?
pgayvallet Oct 1, 2024
e7c482f
fix SO meta
pgayvallet Oct 1, 2024
763dad5
move attributes to server folder
pgayvallet Oct 1, 2024
596b036
some tsdoc
pgayvallet Oct 1, 2024
b3097df
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Oct 1, 2024
dac2b40
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Oct 1, 2024
65cc3e7
add new type to list
pgayvallet Oct 2, 2024
586e30f
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 2, 2024
febae38
installer: WIP
pgayvallet Oct 3, 2024
1f831e1
add plugin config
pgayvallet Oct 3, 2024
b2e3c49
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 4, 2024
5292ad2
add inference endpoint installation logic
pgayvallet Oct 4, 2024
0689dbc
reports install status
pgayvallet Oct 4, 2024
a9f085a
Add bucket content parsing
pgayvallet Oct 7, 2024
bfc8e6a
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 7, 2024
8bbd7e8
create new package
pgayvallet Oct 7, 2024
8e96808
factorize reusable bits into common package
pgayvallet Oct 7, 2024
8c0da9d
rename plugin
pgayvallet Oct 7, 2024
7ba6ee3
commit autochange
pgayvallet Oct 7, 2024
3f16f27
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Oct 7, 2024
af0ee26
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 7, 2024
96e5df5
move things
pgayvallet Oct 7, 2024
3ecaa5b
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 7, 2024
0369210
add first version of search
pgayvallet Oct 8, 2024
7cfb398
tweaks in artifact builder
pgayvallet Oct 8, 2024
258ffc9
add package upgrade check
pgayvallet Oct 9, 2024
63e7597
add llmTasks plugin
pgayvallet Oct 9, 2024
b039828
Add product documentation installation from the o11y assistant config
pgayvallet Oct 11, 2024
75aaaf6
add task availability check, improve summarizer
pgayvallet Oct 14, 2024
7b88930
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 14, 2024
cc727d2
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Oct 14, 2024
0e6e0d6
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 14, 2024
1f11493
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 14, 2024
e4d9f9b
working on config page
pgayvallet Oct 14, 2024
2deea8b
revert old mappings
pgayvallet Oct 14, 2024
55bf175
update limits
pgayvallet Oct 14, 2024
084c78c
rename things
pgayvallet Oct 14, 2024
33fd538
fix imports
pgayvallet Oct 14, 2024
23bb7fd
fix jest file
pgayvallet Oct 14, 2024
05bb3b9
remove type that never existed ever
pgayvallet Oct 14, 2024
c1c01a9
silence i18n check's output
delanni Oct 14, 2024
ed89047
Merge branch 'main' into kbn-193849-add-kb-registry-plugin
delanni Oct 14, 2024
25d6132
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Oct 14, 2024
f67405e
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 14, 2024
0b13919
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Oct 14, 2024
81c4ddf
set logging to quiet in i18n.sh, still log the error in case somethin…
delanni Oct 15, 2024
2fcfdee
self-review, first batch
pgayvallet Oct 14, 2024
0059e66
adding tests
pgayvallet Oct 15, 2024
7448517
more tests and fixes
pgayvallet Oct 16, 2024
77caf77
more tests and fixes bis
pgayvallet Oct 16, 2024
6a15d09
almost done
pgayvallet Oct 16, 2024
d3624d0
last batch of unit tests
pgayvallet Oct 17, 2024
b5116e3
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 17, 2024
b0ac940
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Oct 17, 2024
5797829
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 17, 2024
904416e
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 17, 2024
2c51c37
remove bundle from limits
pgayvallet Oct 17, 2024
3c79e40
fix failures
pgayvallet Oct 17, 2024
83709a8
lint
pgayvallet Oct 17, 2024
0382e2b
add endpoint access control
pgayvallet Oct 17, 2024
63a0e6b
add basic document processing to improve content
pgayvallet Oct 18, 2024
52ccfa9
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 18, 2024
9e96d08
bump summary threshold to 1k
pgayvallet Oct 18, 2024
9807a21
improve summary prompt
pgayvallet Oct 18, 2024
4f23984
change comment
pgayvallet Oct 18, 2024
68978d9
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 23, 2024
ef794c3
remove empty filter
kertal Oct 23, 2024
dec6903
address review comments on i18n script changes
pgayvallet Oct 23, 2024
2425274
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 29, 2024
b62b18b
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Oct 30, 2024
c4824f6
add license check for doc installation
pgayvallet Oct 30, 2024
30ae935
add timeout on endpoint creation
pgayvallet Oct 30, 2024
5ebcef4
fix tool registration due to API change
pgayvallet Oct 30, 2024
64648b0
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 30, 2024
6306a52
fix plugin tests
pgayvallet Oct 30, 2024
1fe4de7
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Nov 7, 2024
3c13779
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Nov 7, 2024
c85e9cc
fix types for new inference package
pgayvallet Nov 7, 2024
0f0a494
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 7, 2024
d7dc1bc
add token / reduction parameters
pgayvallet Nov 7, 2024
17d089c
Address review nits
pgayvallet Nov 11, 2024
2dc68c2
more review nits
pgayvallet Nov 11, 2024
02f286e
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Nov 11, 2024
e31a913
Add instructions for the retrieve doc function
pgayvallet Nov 11, 2024
57ed9d4
nit
pgayvallet Nov 11, 2024
3a08718
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Nov 11, 2024
4feb090
update mappings
pgayvallet Nov 11, 2024
7bb2322
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Nov 11, 2024
7af9f4e
add more unit tests for retrieveDocumentation
pgayvallet Nov 11, 2024
c00c642
use task manager for installation workflows
pgayvallet Nov 12, 2024
5fdd08d
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Nov 12, 2024
0764c0e
create global manager for documentation installation
pgayvallet Nov 13, 2024
be74940
fix getTaskStatus
pgayvallet Nov 13, 2024
3baf56d
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Nov 13, 2024
5f7dbda
fixes due to merge
pgayvallet Nov 13, 2024
27abf46
add audit logging for product doc
pgayvallet Nov 13, 2024
34ba91c
add tests for doc manager
pgayvallet Nov 14, 2024
407430d
fix response ops ftr test
pgayvallet Nov 14, 2024
f2cd9e6
remove semantic text for ai_subtitle
pgayvallet Nov 14, 2024
3858b63
tweak summarize prompt
pgayvallet Nov 14, 2024
75da6ea
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Nov 14, 2024
1ddad2f
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Nov 14, 2024
7063ce4
fix type in test
pgayvallet Nov 15, 2024
c5c9d76
Merge remote-tracking branch 'upstream/main' into kbn-193849-add-kb-r…
pgayvallet Nov 18, 2024
a34e114
update doc
pgayvallet Nov 18, 2024
b9145ef
check status after installation
pgayvallet Nov 18, 2024
040956d
remove unused return type
pgayvallet Nov 18, 2024
09f8b2d
Merge branch 'main' into kbn-193849-add-kb-registry-plugin
elasticmachine Nov 19, 2024
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 .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ src/plugins/kibana_overview @elastic/appex-sharedux
src/plugins/kibana_react @elastic/appex-sharedux
src/plugins/kibana_usage_collection @elastic/kibana-core
src/plugins/kibana_utils @elastic/appex-sharedux
x-pack/plugins/ai_infra/knowledge_base_registry @elastic/appex-ai-infra
x-pack/plugins/kubernetes_security @elastic/kibana-cloud-security-posture
x-pack/packages/kbn-langchain @elastic/security-generative-ai
packages/kbn-language-documentation @elastic/kibana-esql
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,10 @@ the infrastructure monitoring use-case within Kibana.
|undefined


|{kib-repo}blob/{branch}/x-pack/plugins/ai_infra/knowledge_base_registry/README.md[knowledgeBaseRegistry]
|This plugin contains the registry for the knowledge base.


|{kib-repo}blob/{branch}/x-pack/plugins/kubernetes_security/README.md[kubernetesSecurity]
|This plugin provides interactive visualizations of your Kubernetes workload and session data.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@
"@kbn/kibana-react-plugin": "link:src/plugins/kibana_react",
"@kbn/kibana-usage-collection-plugin": "link:src/plugins/kibana_usage_collection",
"@kbn/kibana-utils-plugin": "link:src/plugins/kibana_utils",
"@kbn/knowledge-base-registry-plugin": "link:x-pack/plugins/ai_infra/knowledge_base_registry",
"@kbn/kubernetes-security-plugin": "link:x-pack/plugins/kubernetes_security",
"@kbn/langchain": "link:x-pack/packages/kbn-langchain",
"@kbn/language-documentation": "link:packages/kbn-language-documentation",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pageLoadAssetSize:
kibanaReact: 74422
kibanaUsageCollection: 16463
kibanaUtils: 79713
knowledgeBaseRegistry: 22500
kubernetesSecurity: 77234
lens: 57135
licenseManagement: 41817
Expand Down
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,8 @@
"@kbn/kibana-usage-collection-plugin/*": ["src/plugins/kibana_usage_collection/*"],
"@kbn/kibana-utils-plugin": ["src/plugins/kibana_utils"],
"@kbn/kibana-utils-plugin/*": ["src/plugins/kibana_utils/*"],
"@kbn/knowledge-base-registry-plugin": ["x-pack/plugins/ai_infra/knowledge_base_registry"],
"@kbn/knowledge-base-registry-plugin/*": ["x-pack/plugins/ai_infra/knowledge_base_registry/*"],
"@kbn/kubernetes-security-plugin": ["x-pack/plugins/kubernetes_security"],
"@kbn/kubernetes-security-plugin/*": ["x-pack/plugins/kubernetes_security/*"],
"@kbn/langchain": ["x-pack/packages/kbn-langchain"],
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Knowledge base registry plugin

This plugin contains the registry for the knowledge base.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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 const knowledgeBaseEntryTypeName = 'knowledge_base_entry';
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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.
*/

/**
* Interface describing the raw attributes of the KB Entry SO type.
* Contains more fields than the mappings, which only list
* indexed fields.
*/
export interface KnowledgeBaseEntryAttributes {
name: string;
description?: string;
source: KnowledgeBaseEntrySource;
created_by: KnowledgeBaseEntryCreatedBy;
}

interface KnowledgeBaseEntryIndexSource {
type: 'index';
index_name: string;
syntactic_fields: string[];
semantic_fields: string[];
}

type KnowledgeBaseEntrySource = KnowledgeBaseEntryIndexSource;

interface KnowledgeBaseEntryCreatedByPackage {
type: 'package';
packageName: string;
version: string;
}

type KnowledgeBaseEntryCreatedBy = KnowledgeBaseEntryCreatedByPackage;
23 changes: 23 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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 = {
preset: '@kbn/test',
rootDir: '../../../..',
roots: [
'<rootDir>/x-pack/plugins/ai_infra/knowledge_base_registry/public',
'<rootDir>/x-pack/plugins/ai_infra/knowledge_base_registry/server',
'<rootDir>/x-pack/plugins/ai_infra/knowledge_base_registry/common',
],
setupFiles: [],
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/ai_infra/knowledge_base_registry/{public,server,common}/**/*.{js,ts,tsx}',
],

coverageReporters: ['html'],
};
15 changes: 15 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "plugin",
"id": "@kbn/knowledge-base-registry-plugin",
"owner": "@elastic/appex-ai-infra",
"plugin": {
"id": "knowledgeBaseRegistry",
"server": true,
"browser": true,
"configPath": ["xpack", "knowledgeBaseRegistry"],
"requiredPlugins": [],
"requiredBundles": [],
"optionalPlugins": [],
"extraPublicDirs": []
}
}
26 changes: 26 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/public/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.
*/

import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/public';
import { KnowledgeBaseRegistryPlugin } from './plugin';
import type {
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies,
PublicPluginConfig,
} from './types';

export type { KnowledgeBaseRegistrySetupContract, KnowledgeBaseRegistryStartContract };

export const plugin: PluginInitializer<
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies
> = (pluginInitializerContext: PluginInitializerContext<PublicPluginConfig>) =>
new KnowledgeBaseRegistryPlugin(pluginInitializerContext);
48 changes: 48 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/public/plugin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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.
*/

import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public';
import type { Logger } from '@kbn/logging';
import type {
PublicPluginConfig,
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies,
} from './types';

export class KnowledgeBaseRegistryPlugin
implements
Plugin<
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies
>
{
logger: Logger;

constructor(context: PluginInitializerContext<PublicPluginConfig>) {
this.logger = context.logger.get();
}
setup(
coreSetup: CoreSetup<
KnowledgeBaseRegistryStartDependencies,
KnowledgeBaseRegistryStartContract
>,
pluginsSetup: KnowledgeBaseRegistrySetupDependencies
): KnowledgeBaseRegistrySetupContract {
return {};
}

start(
coreStart: CoreStart,
pluginsStart: KnowledgeBaseRegistryStartDependencies
): KnowledgeBaseRegistryStartContract {
return {};
}
}
18 changes: 18 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/public/types.ts
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.
*/

/* eslint-disable @typescript-eslint/no-empty-interface*/

export interface PublicPluginConfig {}

export interface KnowledgeBaseRegistrySetupDependencies {}

export interface KnowledgeBaseRegistryStartDependencies {}

export interface KnowledgeBaseRegistrySetupContract {}

export interface KnowledgeBaseRegistryStartContract {}
14 changes: 14 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/server/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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.
*/

import { schema, type TypeOf } from '@kbn/config-schema';

export const config = schema.object({
enabled: schema.boolean({ defaultValue: true }),
});

export type KnowledgeBaseRegistryConfig = TypeOf<typeof config>;
26 changes: 26 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/server/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* 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.
*/

import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/server';
import type { KnowledgeBaseRegistryConfig } from './config';
import type {
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies,
} from './types';
import { KnowledgeBaseRegistryPlugin } from './plugin';

export type { KnowledgeBaseRegistrySetupContract, KnowledgeBaseRegistryStartContract };

export const plugin: PluginInitializer<
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies
> = async (pluginInitializerContext: PluginInitializerContext<KnowledgeBaseRegistryConfig>) =>
new KnowledgeBaseRegistryPlugin(pluginInitializerContext);
50 changes: 50 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/server/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.
*/

import type { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/server';
import type { Logger } from '@kbn/logging';
import type { KnowledgeBaseRegistryConfig } from './config';
import type {
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies,
} from './types';
import { knowledgeBaseEntrySavedObjectType } from './saved_objects';

export class KnowledgeBaseRegistryPlugin
implements
Plugin<
KnowledgeBaseRegistrySetupContract,
KnowledgeBaseRegistryStartContract,
KnowledgeBaseRegistrySetupDependencies,
KnowledgeBaseRegistryStartDependencies
>
{
logger: Logger;

constructor(context: PluginInitializerContext<KnowledgeBaseRegistryConfig>) {
this.logger = context.logger.get();
}
setup(
coreSetup: CoreSetup<
KnowledgeBaseRegistryStartDependencies,
KnowledgeBaseRegistryStartContract
>,
pluginsSetup: KnowledgeBaseRegistrySetupDependencies
): KnowledgeBaseRegistrySetupContract {
coreSetup.savedObjects.registerType(knowledgeBaseEntrySavedObjectType);
return {};
}

start(
core: CoreStart,
pluginsStart: KnowledgeBaseRegistryStartDependencies
): KnowledgeBaseRegistryStartContract {
return {};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* 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 { knowledgeBaseEntrySavedObjectType } from './knowledge_base_entry';
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.
*/

import type { SavedObjectsType } from '@kbn/core/server';
import { knowledgeBaseEntryTypeName } from '../../common/consts';
import type { KnowledgeBaseEntryAttributes } from '../../common/saved_objects';

export const knowledgeBaseEntrySavedObjectType: SavedObjectsType<KnowledgeBaseEntryAttributes> = {
name: knowledgeBaseEntryTypeName,
hidden: false,
namespaceType: 'multiple',
mappings: {
dynamic: false,
properties: {
name: { type: 'keyword' },
source: {
type: 'object',
dynamic: false,
properties: {
type: { type: 'keyword' },
},
},
created_by: {
type: 'object',
dynamic: false,
properties: {
type: { type: 'keyword' },
},
},
},
},
management: {
importableAndExportable: false,
visibleInManagement: false,
},
modelVersions: {},
};
16 changes: 16 additions & 0 deletions x-pack/plugins/ai_infra/knowledge_base_registry/server/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 @typescript-eslint/no-empty-interface*/

export interface KnowledgeBaseRegistrySetupDependencies {}

export interface KnowledgeBaseRegistryStartDependencies {}

export interface KnowledgeBaseRegistrySetupContract {}

export interface KnowledgeBaseRegistryStartContract {}
Loading