-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Security Solution] [AI Assistant] Update copy of the citations tour. #210398
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
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9b158e2
Update copy for citations tour + disable citations when they are unav…
KDKHD cdd6193
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine ab98a98
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 1002128
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine beddb3f
Add comment
KDKHD 7e95456
Merge branch 'enhancement/citations-copy' of github.com:KDKHD/kibana …
KDKHD abe6dbd
Merge branch 'main' into enhancement/citations-copy
elasticmachine ae63cf0
Merge branch 'main' into enhancement/citations-copy
KDKHD 1754b7a
Merge branch 'main' into enhancement/citations-copy
elasticmachine 415e22e
Merge branch 'main' into enhancement/citations-copy
elasticmachine 843368f
fix copy
KDKHD da377da
handle metadata for regenerated messages
KDKHD 8128055
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 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
34 changes: 34 additions & 0 deletions
34
...rm/packages/shared/kbn-elastic-assistant/impl/assistant/conversations/utils/index.test.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,34 @@ | ||
| /* | ||
| * 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 { alertConvo, conversationWithContentReferences } from '../../../mock/conversation'; | ||
| import { Conversation } from '../../../..'; | ||
| import { conversationContainsContentReferences, conversationContainsAnonymizedValues } from '.'; | ||
|
|
||
| describe('conversation utils', () => { | ||
| it.each([ | ||
| [undefined, false], | ||
| [conversationWithContentReferences, true], | ||
| [alertConvo, false], | ||
| ])( | ||
| 'conversationContainsContentReferences', | ||
| (conversation: Conversation | undefined, expected: boolean) => { | ||
| expect(conversationContainsContentReferences(conversation)).toBe(expected); | ||
| } | ||
| ); | ||
|
|
||
| it.each([ | ||
| [undefined, false], | ||
| [conversationWithContentReferences, false], | ||
| [alertConvo, true], | ||
| ])( | ||
| 'conversationContainsAnonymizedValues', | ||
| (conversation: Conversation | undefined, expected: boolean) => { | ||
| expect(conversationContainsAnonymizedValues(conversation)).toBe(expected); | ||
| } | ||
| ); | ||
| }); |
20 changes: 20 additions & 0 deletions
20
...latform/packages/shared/kbn-elastic-assistant/impl/assistant/conversations/utils/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,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. | ||
| */ | ||
|
|
||
| import { isEmpty } from 'lodash'; | ||
| import { Conversation } from '../../../..'; | ||
|
|
||
| export const conversationContainsContentReferences = (conversation?: Conversation): boolean => { | ||
| return ( | ||
| conversation?.messages.some((message) => !isEmpty(message.metadata?.contentReferences)) ?? false | ||
| ); | ||
| }; | ||
|
|
||
| /** Checks if the conversations has replacements, not if the replacements are actually used */ | ||
| export const conversationContainsAnonymizedValues = (conversation?: Conversation): boolean => { | ||
| return !isEmpty(conversation?.replacements); | ||
| }; |
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.