Skip to content
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

[NL-to-ESQL] refactor and improve the task's workflow #192850

Merged
merged 9 commits into from
Sep 17, 2024

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Sep 13, 2024

Summary

Some cleanup and minor enhancements, just to get my hands on that part of the code.

evaluation framework was run against gemini1.5, claude-sonnet and GPT-4, with a few improvements

Cleanup

  • Refactor the code to improve readability and maintainability

Improvements

  • Add support for keyword aliases (turns out, some models asks for STATS...BY and not STATS)
  • Add (naive for now) support for suggestion (to try to influence the model on using some function instead of others, e.g group by time with BUCKET instead of DATE_TRUNC)
  • Generate "this command does not exist" documentation when the model request a missing command (help making it understand it shouldn't use the command, e.g gpt-4 was hallucinating a REVERSE command)

@dgieselaar
Copy link
Member

Great to see you dumb this down for the mere mortals @pgayvallet !!!

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet added release_note:skip Skip the PR/issue when compiling release notes v8.16.0 Team:AI Infra AppEx AI Infrastructure Team backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development labels Sep 17, 2024
@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet marked this pull request as ready for review September 17, 2024 13:03
@pgayvallet pgayvallet requested review from a team as code owners September 17, 2024 13:03
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-ai-infra (Team:AI Infra)

@pgayvallet pgayvallet changed the title [NL-to-ESQL] refactor and improve for task's workflow [NL-to-ESQL] refactor and improve the task's workflow Sep 17, 2024
@pgayvallet
Copy link
Contributor Author

@elasticmachine merge upstream

@pgayvallet pgayvallet enabled auto-merge (squash) September 17, 2024 16:02
@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 17, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 97a689c
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-192850-97a689c24f00

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #5 / Create does not render default value when setDefaultValue is false

Metrics [docs]

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
inference 12 14 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pgayvallet pgayvallet merged commit 0fc191a into elastic:main Sep 17, 2024
23 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 17, 2024
## Summary

Some cleanup and minor enhancements, just to get my hands on that part
of the code.

evaluation framework was run against gemini1.5, claude-sonnet and GPT-4,
with a few improvements

### Cleanup

- Refactor the code to improve readability and maintainability

### Improvements

- Add support for keyword aliases (turns out, some models asks for
`STATS...BY` and not `STATS`)
- Add (naive for now) support for suggestion (to try to influence the
model on using some function instead of others, e.g group by time with
BUCKET instead of DATE_TRUNC)
- Generate "this command does not exist" documentation when the model
request a missing command (help making it understand it shouldn't use
the command, e.g gpt-4 was hallucinating a `REVERSE` command)

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 0fc191a)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.15 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.15:
- Integration assistant generate readme (#192887)
- [Infra] Add observability feature id to host request (#192898)
- Upgrade express 4.19.2→4.21.0 (#192862)
- [Response Ops] Fix maintenance window custom schedule create and update error (#192649)
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 192850

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 17, 2024
…2850) (#193207)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[NL-to-ESQL] refactor and improve the task&#x27;s workflow
(#192850)](#192850)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Pierre
Gayvallet","email":"pierre.gayvallet@elastic.co"},"sourceCommit":{"committedDate":"2024-09-17T16:54:36Z","message":"[NL-to-ESQL]
refactor and improve the task's workflow (#192850)\n\n##
Summary\r\n\r\nSome cleanup and minor enhancements, just to get my hands
on that part\r\nof the code.\r\n\r\nevaluation framework was run against
gemini1.5, claude-sonnet and GPT-4,\r\nwith a few
improvements\r\n\r\n### Cleanup\r\n\r\n- Refactor the code to improve
readability and maintainability\r\n\r\n### Improvements\r\n\r\n- Add
support for keyword aliases (turns out, some models asks
for\r\n`STATS...BY` and not `STATS`)\r\n- Add (naive for now) support
for suggestion (to try to influence the\r\nmodel on using some function
instead of others, e.g group by time with\r\nBUCKET instead of
DATE_TRUNC)\r\n- Generate \"this command does not exist\" documentation
when the model\r\nrequest a missing command (help making it understand
it shouldn't use\r\nthe command, e.g gpt-4 was hallucinating a `REVERSE`
command)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0fc191aa320db4b7949f1c2d47a273a5362029c8","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major","Team:Obs
AI Assistant","ci:project-deploy-observability","v8.16.0","Team:AI
Infra"],"title":"[NL-to-ESQL] refactor and improve the task's
workflow","number":192850,"url":"https://github.com/elastic/kibana/pull/192850","mergeCommit":{"message":"[NL-to-ESQL]
refactor and improve the task's workflow (#192850)\n\n##
Summary\r\n\r\nSome cleanup and minor enhancements, just to get my hands
on that part\r\nof the code.\r\n\r\nevaluation framework was run against
gemini1.5, claude-sonnet and GPT-4,\r\nwith a few
improvements\r\n\r\n### Cleanup\r\n\r\n- Refactor the code to improve
readability and maintainability\r\n\r\n### Improvements\r\n\r\n- Add
support for keyword aliases (turns out, some models asks
for\r\n`STATS...BY` and not `STATS`)\r\n- Add (naive for now) support
for suggestion (to try to influence the\r\nmodel on using some function
instead of others, e.g group by time with\r\nBUCKET instead of
DATE_TRUNC)\r\n- Generate \"this command does not exist\" documentation
when the model\r\nrequest a missing command (help making it understand
it shouldn't use\r\nthe command, e.g gpt-4 was hallucinating a `REVERSE`
command)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0fc191aa320db4b7949f1c2d47a273a5362029c8"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192850","number":192850,"mergeCommit":{"message":"[NL-to-ESQL]
refactor and improve the task's workflow (#192850)\n\n##
Summary\r\n\r\nSome cleanup and minor enhancements, just to get my hands
on that part\r\nof the code.\r\n\r\nevaluation framework was run against
gemini1.5, claude-sonnet and GPT-4,\r\nwith a few
improvements\r\n\r\n### Cleanup\r\n\r\n- Refactor the code to improve
readability and maintainability\r\n\r\n### Improvements\r\n\r\n- Add
support for keyword aliases (turns out, some models asks
for\r\n`STATS...BY` and not `STATS`)\r\n- Add (naive for now) support
for suggestion (to try to influence the\r\nmodel on using some function
instead of others, e.g group by time with\r\nBUCKET instead of
DATE_TRUNC)\r\n- Generate \"this command does not exist\" documentation
when the model\r\nrequest a missing command (help making it understand
it shouldn't use\r\nthe command, e.g gpt-4 was hallucinating a `REVERSE`
command)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"0fc191aa320db4b7949f1c2d47a273a5362029c8"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Pierre Gayvallet <pierre.gayvallet@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.16, 8.15) the previous major branch and all later branches still in development ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:AI Infra AppEx AI Infrastructure Team Team:Obs AI Assistant v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants