[8.19] [Obs AI Assistant] Anonymization support (#223351)#224100
[8.19] [Obs AI Assistant] Anonymization support (#223351)#224100neptunian merged 3 commits intoelastic:8.19from
Conversation
Re-submit of elastic#216352 as it has merge conflicts and we don't have write permissions for Sandra's remote. To test, add the following to your kibana.yml: ``` uiSettings: overrides: "observability:aiAssistantAnonymizationRules": - id: "ner" type: "ner" enabled: true - id: "beach" type: "regex" enabled: true pattern: "sandy" ``` --------- Co-authored-by: Sandra Gonzales <sandra.gonzales@elastic.co> Co-authored-by: Sandra G <neptunian@users.noreply.github.com> (cherry picked from commit 71ec37a) # Conflicts: # x-pack/platform/packages/shared/kbn-ai-assistant/src/chat/chat_timeline.tsx # x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
ecb5e38 to
8dd1022
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
|
| import { ChatItemContentInlinePromptEditor } from './chat_item_content_inline_prompt_editor'; | ||
| import { ChatTimelineItem } from './chat_timeline'; | ||
|
|
||
| // Helper function to extract plain text from a React node. |
There was a problem hiding this comment.
| // Helper function to extract plain text from a React node. | |
| // Helper function to extract plain text from a React node. |
| return extractTextFromReactNode(node.props.children); | ||
| } | ||
| return ''; | ||
| } |
| parts.push(content.substring(lastIndex)); | ||
| } | ||
| return parts; | ||
| } |
| import { DetectedEntity } from '../../types'; | ||
| /** Regex matching object‑hash placeholders (40 hex chars) */ | ||
| export const HASH_REGEX = /[0-9a-f]{40}/g; | ||
| /** |
| }) | ||
| from(this.dependencies.anonymizationService.redactMessages(messages)).pipe( | ||
| switchMap(({ redactedMessages }) => { | ||
| this.dependencies.logger.debug( |
There was a problem hiding this comment.
We can remove this debug line I think as it's the same as the debug line in L496
|
|
||
| return redacted; | ||
| } | ||
| /** |
| } | ||
| >; | ||
|
|
||
| // with unredactions |
There was a problem hiding this comment.
| // with unredactions | |
| // with unredactions |
| class_name: string; | ||
| hash: string; | ||
| }>; | ||
| } |
| } | ||
| return { unredactedMessages: messages }; | ||
| } | ||
| unredactChatCompletionEvent(): OperatorFunction< |
There was a problem hiding this comment.
| unredactChatCompletionEvent(): OperatorFunction< | |
| unredactChatCompletionEvent(): OperatorFunction< |
| content: message.message.content, | ||
| }; | ||
| } | ||
| export function getRedactableMessageEventParts(event: ChatCompletionMessageEvent) { |
There was a problem hiding this comment.
| export function getRedactableMessageEventParts(event: ChatCompletionMessageEvent) { | |
| export function getRedactableMessageEventParts(event: ChatCompletionMessageEvent) { |
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation