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
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ export type {
AgentEventEmitter,
RunAgentOnEventFn,
} from './agents';
export { chatSystemIndex, chatSystemIndexPrefix } from './src/indices';
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

/**
* Prefix of the chat system indices.
*
* The Kibana system user has the same permission on those indices than it has on Kibana system indices.
*/
export const chatSystemIndexPrefix = '.chat-';

/**
* Helper function to define chat system indices.
*/
export const chatSystemIndex = (suffix: string): string => {
return `${chatSystemIndexPrefix}${suffix}`;
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import type { IndexStorageSettings } from '@kbn/storage-adapter';
import { StorageIndexAdapter, types } from '@kbn/storage-adapter';
import type { Logger, ElasticsearchClient } from '@kbn/core/server';
import type { AgentType, ToolSelection } from '@kbn/onechat-common';
import { chatSystemIndex } from '@kbn/onechat-server';

export const agentProfilesIndexName = '.kibana_onechat_agents';
export const agentsIndexName = chatSystemIndex('agents');

const storageSettings = {
name: agentProfilesIndexName,
name: agentsIndexName,
schema: {
properties: {
name: types.keyword({}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import type { Logger, ElasticsearchClient } from '@kbn/core/server';
import type { IndexStorageSettings } from '@kbn/storage-adapter';
import { StorageIndexAdapter, types } from '@kbn/storage-adapter';
import type { ConversationRound } from '@kbn/onechat-common';
import { chatSystemIndex } from '@kbn/onechat-server';

export const conversationIndexName = '.kibana_onechat_conversations';
export const conversationIndexName = chatSystemIndex('conversations');

const storageSettings = {
name: conversationIndexName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import type { Logger, ElasticsearchClient } from '@kbn/core/server';
import type { ToolType } from '@kbn/onechat-common';
import type { IndexStorageSettings } from '@kbn/storage-adapter';
import { StorageIndexAdapter, types } from '@kbn/storage-adapter';
import { chatSystemIndex } from '@kbn/onechat-server';

export const toolIndexName = '.kibana_onechat_tools';
export const toolIndexName = chatSystemIndex('tools');

const storageSettings = {
name: toolIndexName,
Expand Down