[Obs AI Assistant] Migrate anonymization to inference#225539
[Obs AI Assistant] Migrate anonymization to inference#225539dgieselaar merged 54 commits intoelastic:mainfrom
Conversation
...k/platform/plugins/shared/inference/server/chat_complete/anonymization/anonymize_messages.ts
Outdated
Show resolved
Hide resolved
...k/platform/plugins/shared/inference/server/chat_complete/anonymization/anonymize_messages.ts
Outdated
Show resolved
Hide resolved
.../platform/plugins/shared/inference/server/chat_complete/anonymization/deanonymize_message.ts
Outdated
Show resolved
Hide resolved
|
|
||
| return result; | ||
| }), | ||
| defaultIfEmpty(messages) |
There was a problem hiding this comment.
the filter is strict, checking for deanonymized_input or deanonymized_output and if nothing passes it, nothing will emit without this. I could broaden the filter and add some conditions and return the message in there if that's a preferred style / safer. I thought this was a bit more readable.
x-pack/platform/plugins/shared/observability_ai_assistant/common/types.ts
Outdated
Show resolved
Hide resolved
| toolCalls?: Array<{ | ||
| toolCallId: string; | ||
| function: { | ||
| name: string; | ||
| arguments: Record<string, any>; | ||
| }; | ||
| }>; |
There was a problem hiding this comment.
I get confused about the data modeling here. I think this should either just be the output from the inference client, or it should be our own model (which means single function_call).
There was a problem hiding this comment.
Isn't that the output from the inference client? array of toolCalls.
There was a problem hiding this comment.
what I mean is you have mixed up the types from the inference client (indeed, multiple tool calls), and our format: name is ours, toolCallId is from the inference client, but they serve the same purpose (identifying the tool call request). We can leave it for later but we should fix it.
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
…om/neptunian/kibana into migrate-anonymization-to-inference
4db3492 to
d620263
Compare
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
|
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/16114647517 |
- Migrates anonymization functionality from observability ai assistant to inference plugin - Migrates the anonymization rules advanced / ui setting to inference plugin - Changes advanced setting to `aiAssistant:anonymizationRules` and adds `allowedEntityClasses` for users to specify which entity types to anonymize from the NER model code contribution models: claud 3.7 sonnet, o3 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit b1bdc6e)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…#226763) # Backport This will backport the following commits from `main` to `9.1`: - [[Obs AI Assistant] Migrate anonymization to inference (#225539)](#225539) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"neptunian@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-07T10:36:37Z","message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs AI Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Obs AI Assistant] Migrate anonymization to inference","number":225539,"url":"https://github.com/elastic/kibana/pull/225539","mergeCommit":{"message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225539","number":225539,"mergeCommit":{"message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354"}}]}] BACKPORT--> Co-authored-by: Sandra G <neptunian@users.noreply.github.com> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Migrates anonymization functionality from observability ai assistant to inference plugin - Migrates the anonymization rules advanced / ui setting to inference plugin - Changes advanced setting to `aiAssistant:anonymizationRules` and adds `allowedEntityClasses` for users to specify which entity types to anonymize from the NER model code contribution models: claud 3.7 sonnet, o3 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit b1bdc6e) # Conflicts: # x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
#227543) # Backport This will backport the following commits from `main` to `8.19`: - [[Obs AI Assistant] Migrate anonymization to inference (#225539)](#225539) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"neptunian@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-07-07T10:36:37Z","message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs AI Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Obs AI Assistant] Migrate anonymization to inference","number":225539,"url":"https://github.com/elastic/kibana/pull/225539","mergeCommit":{"message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226763","number":226763,"state":"MERGED","mergeCommit":{"sha":"44f745deae84da15c906bb64d2a9607b493b40b7","message":"[9.1] [Obs AI Assistant] Migrate anonymization to inference (#225539) (#226763)\n\n# Backport\n\nThis will backport the following commits from `main` to `9.1`:\n- [[Obs AI Assistant] Migrate anonymization to inference\n(#225539)](https://github.com/elastic/kibana/pull/225539)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Sandra G <neptunian@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225539","number":225539,"mergeCommit":{"message":"[Obs AI Assistant] Migrate anonymization to inference (#225539)\n\n- Migrates anonymization functionality from observability ai assistant\nto inference plugin\n- Migrates the anonymization rules advanced / ui setting to inference\nplugin\n- Changes advanced setting to `aiAssistant:anonymizationRules` and adds\n`allowedEntityClasses` for users to specify which entity types to\nanonymize from the NER model\n\n\ncode contribution models: claud 3.7 sonnet, o3\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"b1bdc6ec58e8f16ea9f6b84e80304a05a475f354"}}]}] BACKPORT-->
## Summary Followup to #225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3).
## Summary Followup to elastic#225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3). (cherry picked from commit 1b9063a)
## Summary Followup to elastic#225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3). (cherry picked from commit 1b9063a)
- Migrates anonymization functionality from observability ai assistant to inference plugin - Migrates the anonymization rules advanced / ui setting to inference plugin - Changes advanced setting to `aiAssistant:anonymizationRules` and adds `allowedEntityClasses` for users to specify which entity types to anonymize from the NER model code contribution models: claud 3.7 sonnet, o3 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary Followup to elastic#225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3).
aiAssistant:anonymizationRulesand addsallowedEntityClassesfor users to specify which entity types to anonymize from the NER modelcode contribution models: claud 3.7 sonnet, o3