-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[AI Assistant] Add to dashboard #179329
[AI Assistant] Add to dashboard #179329
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
8b0a71f
to
79fcedb
Compare
8eadd3f
to
0b8ef48
Compare
* [AI Assistant] Add setting for preferred type * Update telemetry/tests * [Obs AI Assistant] Add to dashboard in Discover * Simplifications and fixes * Fix ES|QL type lens embeddable --------- Co-authored-by: Dario Gieselaar <[email protected]>
The circular dependency happens because the lens-embeddable-utils needs a type from the maps which on their side have a dependency on the dashboard. The dependency on the dashboard on the maps level can be removed. I will take care of it on another PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@sorenlouv both good points I think, can you create issues for those? |
/ci |
@stratoula @dgieselaar this works great. Almost all of the feedback I shared here has been addressed. A small UI thing unrelated with the PR but relevant when using the Assistant in dashboards. If I have the Assistant open as a push flyout and I click on "Edit visualization", the Assistant should be closed and the viz flyout for the inline editor should be open. Instead, the Assistant hides the editor behind now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great! Next step is to show the assistant by default in dashboards instead of hiding this behind an Adevanced Config so everyone can enjoy these amazing features :)
Thanx Teresa for looking again into this! I know about this and I want to find a way to tackle this but yes is not relevant with this PR! |
maxFontSize: 72, | ||
minFontSize: 12, | ||
orientation: 'single', | ||
showLabel: true, | ||
...(layer.breakdown | ||
? { | ||
tagAccessor: !isFormula ? (layer.breakdown as string) : getAccessorName('breakdown'), | ||
tagAccessor: getAccessorName('breakdown'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing the formula support here and above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesnt remove the formula support. (!isFormula
) It is fixing a bug in the ES|QL implementation, if you check the rest implementations they use the same logic. This got missed and the tagclouds were not working properly for all cases (I had checked with Peter back then too, is a very old PR)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Heenawter thanx Soren mentioned it above #179329 (comment) |
@stratoula I think that's a different error, fwiw |
Different message, I missed that. Can you help me replicate @Heenawter ? I have never seen it personally |
/ci |
/ci |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
I synced with Hannah offline and she cant reproduce it now (neither can I) |
Adds a new functionality in the AI assistant when in dashboards. If the users ask for a question which will generate a query then then can use prompts like: - `Create a visualization from this query and add this to a dashboard` - `Create a metric from this query and add this to a dashboard` - .... ![meow](https://github.com/elastic/kibana/assets/17003240/3092f006-13ce-4565-b9d3-c6ad407afb31) ### How it works - It uses the existing functionality of the assistant to create an ES|QL query (if the generated query is wrong is not part of this PR) - The LLM returns the query to the new `add_to_dashboard` function and with the chart type (if the user has added the preference) and the configuration needed for the ConfigBuilder it creates a Lens embeddable and adds it to the dashboard. ### How to test - Go to advanced settings, find the `Observability AI Assistant scope` setting and change to Everywhere - Go to a dahsboard (existing or new) - Ask a question to the AI such as `I want the 95th percentile of ... from ... index` or `I want the median of butes from the kibana_sample_data_logs grouped by the top 5 destinations` - After the ES|QL query has been generated correctly ask AI to create a chart from this query and add this to the dashboard ### important note As this is the first real consumer of the build api for ES|QL I have fixed and various bugs I discovered in the api. --------- Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: Stratoula Kalafateli <[email protected]> Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 4013f60)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.15`: - [[AI Assistant] Add to dashboard (#179329)](#179329) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Dario Gieselaar","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-07-09T07:31:54Z","message":"[AI Assistant] Add to dashboard (#179329)\n\nAdds a new functionality in the AI assistant when in dashboards. If the\r\nusers ask for a question which will generate a query then then can use\r\nprompts like:\r\n\r\n- `Create a visualization from this query and add this to a dashboard`\r\n- `Create a metric from this query and add this to a dashboard`\r\n- ....\r\n\r\n\r\n![meow](https://github.com/elastic/kibana/assets/17003240/3092f006-13ce-4565-b9d3-c6ad407afb31)\r\n\r\n\r\n### How it works\r\n- It uses the existing functionality of the assistant to create an ES|QL\r\nquery (if the generated query is wrong is not part of this PR)\r\n- The LLM returns the query to the new `add_to_dashboard` function and\r\nwith the chart type (if the user has added the preference) and the\r\nconfiguration needed for the ConfigBuilder it creates a Lens embeddable\r\nand adds it to the dashboard.\r\n\r\n### How to test\r\n- Go to advanced settings, find the `Observability AI Assistant scope`\r\nsetting and change to Everywhere\r\n- Go to a dahsboard (existing or new)\r\n- Ask a question to the AI such as `I want the 95th percentile of ...\r\nfrom ... index` or `I want the median of butes from the\r\nkibana_sample_data_logs grouped by the top 5 destinations`\r\n- After the ES|QL query has been generated correctly ask AI to create a\r\nchart from this query and add this to the dashboard\r\n\r\n\r\n### important note\r\nAs this is the first real consumer of the build api for ES|QL I have\r\nfixed and various bugs I discovered in the api.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"4013f608c1872b75f4f5601889a478b985479859","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","Team:Obs AI Assistant","Feature:ES|QL","ci:project-deploy-observability","apm:review","v8.15.0","v8.16.0"],"title":"[AI Assistant] Add to dashboard","number":179329,"url":"https://github.com/elastic/kibana/pull/179329","mergeCommit":{"message":"[AI Assistant] Add to dashboard (#179329)\n\nAdds a new functionality in the AI assistant when in dashboards. If the\r\nusers ask for a question which will generate a query then then can use\r\nprompts like:\r\n\r\n- `Create a visualization from this query and add this to a dashboard`\r\n- `Create a metric from this query and add this to a dashboard`\r\n- ....\r\n\r\n\r\n![meow](https://github.com/elastic/kibana/assets/17003240/3092f006-13ce-4565-b9d3-c6ad407afb31)\r\n\r\n\r\n### How it works\r\n- It uses the existing functionality of the assistant to create an ES|QL\r\nquery (if the generated query is wrong is not part of this PR)\r\n- The LLM returns the query to the new `add_to_dashboard` function and\r\nwith the chart type (if the user has added the preference) and the\r\nconfiguration needed for the ConfigBuilder it creates a Lens embeddable\r\nand adds it to the dashboard.\r\n\r\n### How to test\r\n- Go to advanced settings, find the `Observability AI Assistant scope`\r\nsetting and change to Everywhere\r\n- Go to a dahsboard (existing or new)\r\n- Ask a question to the AI such as `I want the 95th percentile of ...\r\nfrom ... index` or `I want the median of butes from the\r\nkibana_sample_data_logs grouped by the top 5 destinations`\r\n- After the ES|QL query has been generated correctly ask AI to create a\r\nchart from this query and add this to the dashboard\r\n\r\n\r\n### important note\r\nAs this is the first real consumer of the build api for ES|QL I have\r\nfixed and various bugs I discovered in the api.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"4013f608c1872b75f4f5601889a478b985479859"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/179329","number":179329,"mergeCommit":{"message":"[AI Assistant] Add to dashboard (#179329)\n\nAdds a new functionality in the AI assistant when in dashboards. If the\r\nusers ask for a question which will generate a query then then can use\r\nprompts like:\r\n\r\n- `Create a visualization from this query and add this to a dashboard`\r\n- `Create a metric from this query and add this to a dashboard`\r\n- ....\r\n\r\n\r\n![meow](https://github.com/elastic/kibana/assets/17003240/3092f006-13ce-4565-b9d3-c6ad407afb31)\r\n\r\n\r\n### How it works\r\n- It uses the existing functionality of the assistant to create an ES|QL\r\nquery (if the generated query is wrong is not part of this PR)\r\n- The LLM returns the query to the new `add_to_dashboard` function and\r\nwith the chart type (if the user has added the preference) and the\r\nconfiguration needed for the ConfigBuilder it creates a Lens embeddable\r\nand adds it to the dashboard.\r\n\r\n### How to test\r\n- Go to advanced settings, find the `Observability AI Assistant scope`\r\nsetting and change to Everywhere\r\n- Go to a dahsboard (existing or new)\r\n- Ask a question to the AI such as `I want the 95th percentile of ...\r\nfrom ... index` or `I want the median of butes from the\r\nkibana_sample_data_logs grouped by the top 5 destinations`\r\n- After the ES|QL query has been generated correctly ask AI to create a\r\nchart from this query and add this to the dashboard\r\n\r\n\r\n### important note\r\nAs this is the first real consumer of the build api for ES|QL I have\r\nfixed and various bugs I discovered in the api.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: Stratoula Kalafateli <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"4013f608c1872b75f4f5601889a478b985479859"}}]}] BACKPORT--> Co-authored-by: Dario Gieselaar <[email protected]>
Adds a new functionality in the AI assistant when in dashboards. If the users ask for a question which will generate a query then then can use prompts like:
Create a visualization from this query and add this to a dashboard
Create a metric from this query and add this to a dashboard
How it works
add_to_dashboard
function and with the chart type (if the user has added the preference) and the configuration needed for the ConfigBuilder it creates a Lens embeddable and adds it to the dashboard.How to test
Observability AI Assistant scope
setting and change to EverywhereI want the 95th percentile of ... from ... index
orI want the median of butes from the kibana_sample_data_logs grouped by the top 5 destinations
important note
As this is the first real consumer of the build api for ES|QL I have fixed and various bugs I discovered in the api.