-
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
allows AI assistant to get info about available indices and their fields #165952
Conversation
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.
I was not able to test it locally but changes look good to me. I think is a great enhancement for the ai assistant and is much more generic that it works with indices instead of dataviews (also will be super helpful for creating ESQL queries as they work with indices and not dataviews)
x-pack/plugins/observability_ai_assistant/public/functions/get_dataet_info.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_ai_assistant/public/functions/get_dataet_info.ts
Outdated
Show resolved
Hide resolved
d99390e
to
77f6f2c
Compare
8bbf17c
to
9bfd47d
Compare
I tested your latest changes Peter and is much better experience now. It is much smarter, I really like it! |
x-pack/plugins/observability_ai_assistant/public/functions/get_dataset_info.ts
Outdated
Show resolved
Hide resolved
@@ -263,6 +271,8 @@ export function registerLensFunction({ | |||
}, | |||
}); | |||
|
|||
if (!timeField) return; |
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.
should we not default to @timestamp
in this case? Have you seen the LLM respond with an empty string?
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.
for some reason lens function gets executed multiple times sometimes, where first time (or not the last time) is missing properties. seems to be a bug somewhere else in our rendering, but i wasn't able to find it, so i added a check here to make sure we only render the chart once timefield is set.
timefield should actually never be empty as it has default value set.
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.
for some reason lens function gets executed multiple times sometimes, where first time (or not the last time) is missing properties. seems to be a bug somewhere else in our rendering, but i wasn't able to find it, so i added a check here to make sure we only render the chart once timefield is set.
Not sure if I follow. Why is it a problem if it renders multiple times? (I assume it renders multiple times, but to the same element)
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.
not on its own, but lens seems to be doing multiple requests then, which is a performance hit if nothing else. i think its safe to not render until we get all the required properties
x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/observability_ai_assistant/server/service/client/index.ts
Outdated
Show resolved
Hide resolved
…_dataet_info.ts Co-authored-by: Stratoula Kalafateli <[email protected]>
…-ref HEAD~1..HEAD --fix'
…aiassistant/get_dataviews
@ppisljar I made some changes - hopefully that's it for now. I no longer compress the fields - the LLM was struggling with decoding the fields and it started hallucinating. As a compromise, I don't send over the field types anymore (when asking the LLM to filter) - I don't think the LLM needs it and that saves a bunch of tokens as well. I feel like it works pretty good now! |
@dgieselaar sounds good for now, if we figure out we need types we can always add them later and maybe compress the type string to a character or sth. |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
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 on connector changes
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…lds (elastic#165952) (cherry picked from commit 89562db) # Conflicts: # x-pack/plugins/observability_ai_assistant/public/functions/index.ts
…eir fields (#165952) (#169908) # Backport This will backport the following commits from `main` to `8.11`: - [allows AI assistant to get info about available indices and their fields (#165952)](#165952) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Peter Pisljar","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-20T04:20:06Z","message":"allows AI assistant to get info about available indices and their fields (#165952)","sha":"89562dbac35bb9f4e05785bd0bf96a2e94d71565","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.11.0","v8.12.0"],"number":165952,"url":"https://github.com/elastic/kibana/pull/165952","mergeCommit":{"message":"allows AI assistant to get info about available indices and their fields (#165952)","sha":"89562dbac35bb9f4e05785bd0bf96a2e94d71565"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/165952","number":165952,"mergeCommit":{"message":"allows AI assistant to get info about available indices and their fields (#165952)","sha":"89562dbac35bb9f4e05785bd0bf96a2e94d71565"}}]}] BACKPORT-->
Summary
allow AI assistant to get into about available indices and their fields
get_dataset_info(index?: string)
if index is not passed, list of all indices is returned. if index is given fields for that index are returned.
example screenshot: