-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add connector and scope information to Obs AI Assistant EBT events #234550
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
Merged
arturoliduena
merged 9 commits into
elastic:main
from
arturoliduena:obs-ai-assistant-232546-EBT-connector-info
Sep 15, 2025
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8801d05
Add connector and scope information to Obs AI Assistant EBT events
arturoliduena 2e409ff
update tests
arturoliduena a35e056
Add connector and scope information to observability_ai_assistant_rec…
arturoliduena 6789f8f
Merge branch 'main' into obs-ai-assistant-232546-EBT-connector-info
arturoliduena 51a595b
[Connector] Rename: family to modelFamily and provider to modelProvider
arturoliduena 600e4eb
Merge branch 'main' into obs-ai-assistant-232546-EBT-connector-info
arturoliduena fce31d6
update observabilityAIAssistant limit page load bundle size
arturoliduena e6b008c
update tests
arturoliduena 3ff3f92
Merge branch 'main' into obs-ai-assistant-232546-EBT-connector-info
arturoliduena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
x-pack/platform/plugins/shared/observability_ai_assistant/common/analytics/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
| */ | ||
|
|
||
| export { type Connector, connectorSchema } from './schemas/connector'; | ||
| export { type Scope, scopeSchema } from './schemas/scope'; |
53 changes: 53 additions & 0 deletions
53
.../platform/plugins/shared/observability_ai_assistant/common/analytics/schemas/connector.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /* | ||
| * 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 { RootSchema } from '@kbn/core/public'; | ||
| import type { InferenceConnector } from '../../utils/get_inference_connector'; | ||
|
|
||
| export interface Connector { | ||
| connector: InferenceConnector | undefined; | ||
| } | ||
|
|
||
| export const connectorSchema: RootSchema<Connector['connector']> = { | ||
| connectorId: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The id of the connector.', | ||
| }, | ||
| }, | ||
| name: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The name of the connector.', | ||
| }, | ||
| }, | ||
| type: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The action type id of the connector.', | ||
| }, | ||
| }, | ||
| family: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The model family of the connector.', | ||
| }, | ||
| }, | ||
| provider: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The model provider of the connector.', | ||
| }, | ||
| }, | ||
| modelId: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'The model id of the connector, if applicable.', | ||
| optional: true, | ||
| }, | ||
| }, | ||
| }; |
23 changes: 23 additions & 0 deletions
23
x-pack/platform/plugins/shared/observability_ai_assistant/common/analytics/schemas/scope.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
| */ | ||
|
|
||
| import type { SchemaValue } from '@kbn/core/public'; | ||
| import type { AssistantScope } from '@kbn/ai-assistant-common'; | ||
|
|
||
| export interface Scope { | ||
| scopes: AssistantScope[]; | ||
| } | ||
|
|
||
| export const scopeSchema: SchemaValue<AssistantScope[]> = { | ||
| type: 'array', | ||
| items: { | ||
| type: 'text', | ||
| _meta: { | ||
| description: 'Scope of the AI Assistant', | ||
| }, | ||
| }, | ||
| }; |
46 changes: 46 additions & 0 deletions
46
...latform/plugins/shared/observability_ai_assistant/common/utils/get_inference_connector.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * 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 { Connector } from '@kbn/actions-plugin/server'; | ||
| import { | ||
| getConnectorProvider, | ||
| getConnectorFamily, | ||
| getConnectorModel, | ||
| connectorToInference, | ||
| type InferenceConnectorType, | ||
| type ModelFamily, | ||
| type ModelProvider, | ||
| } from '@kbn/inference-common'; | ||
|
|
||
| export interface InferenceConnector { | ||
| connectorId: string; | ||
| name: string; | ||
| type: InferenceConnectorType; | ||
| family: ModelFamily; | ||
| provider: ModelProvider; | ||
arturoliduena marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| modelId: string | undefined; | ||
| } | ||
|
|
||
| export const getInferenceConnectorInfo = ( | ||
| connector?: Connector | ||
| ): InferenceConnector | undefined => { | ||
| if (!connector) { | ||
| return; | ||
| } | ||
| const inferenceConnector = connectorToInference(connector); | ||
| const family = getConnectorFamily(inferenceConnector); | ||
| const provider = getConnectorProvider(inferenceConnector); | ||
| const modelId = getConnectorModel(inferenceConnector); | ||
| return { | ||
| connectorId: inferenceConnector.connectorId, | ||
| name: inferenceConnector.name, | ||
| type: inferenceConnector.type, | ||
| family, | ||
arturoliduena marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| provider, | ||
arturoliduena marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| modelId, | ||
| }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.