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

[inference] Add simulated function calling #192544

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Sep 11, 2024

Summary

Add simulated function calling to the inference plugin. For now, only the openAI adapter is supported. This is done by adding a new, optional functionCalling parameter to the chat and task APIs

Implementation was adapted from the equivalent feature in the o11y assistant.

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet
Copy link
Contributor Author

/ci

@pgayvallet pgayvallet added v8.16.0 Team:AI Infra AppEx AI Infrastructure Team release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Sep 17, 2024
@pgayvallet
Copy link
Contributor Author

/ci

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

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

const stream = true;
// TODO: remove before merge
const simulatedFunctionCalling = true; // functionCalling === 'simulated';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge
// TODO: remove before merge

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not a bug, it's a feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels Sep 17, 2024
Copy link
Member

@dgieselaar dgieselaar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot a todo there BUT because you're a grown up and will take care of it I approve!

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

kibana-ci commented Sep 18, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 9b09b24
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-192544-9b09b24706a8

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observabilityAIAssistantApp 154.3KB 154.3KB +64.0B

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 14 15 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
inference 5.7KB 5.8KB +92.0B

History

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

@pgayvallet pgayvallet merged commit 181d617 into elastic:main Sep 18, 2024
22 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 18, 2024
## Summary

Add simulated function calling to the inference plugin. For now, only
the openAI adapter is supported. This is done by adding a new, optional
`functionCalling` parameter to the chat and task APIs

Implementation was adapted from the equivalent feature in the o11y
assistant.

---------

Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
(cherry picked from commit 181d617)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 18, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[inference] Add simulated function calling
(#192544)](#192544)

<!--- 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-18T10:42:28Z","message":"[inference]
Add simulated function calling (#192544)\n\n## Summary\r\n\r\nAdd
simulated function calling to the inference plugin. For now, only\r\nthe
openAI adapter is supported. This is done by adding a new,
optional\r\n`functionCalling` parameter to the chat and task
APIs\r\n\r\nImplementation was adapted from the equivalent feature in
the o11y\r\nassistant.\r\n\r\n---------\r\n\r\nCo-authored-by: Dario
Gieselaar
<dario.gieselaar@elastic.co>","sha":"181d61723136084ec57801fab1cc99457c047977","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-minor","Team:Obs
AI Assistant","ci:project-deploy-observability","v8.16.0","Team:AI
Infra"],"title":"[inference] Add simulated function calling
","number":192544,"url":"https://github.com/elastic/kibana/pull/192544","mergeCommit":{"message":"[inference]
Add simulated function calling (#192544)\n\n## Summary\r\n\r\nAdd
simulated function calling to the inference plugin. For now, only\r\nthe
openAI adapter is supported. This is done by adding a new,
optional\r\n`functionCalling` parameter to the chat and task
APIs\r\n\r\nImplementation was adapted from the equivalent feature in
the o11y\r\nassistant.\r\n\r\n---------\r\n\r\nCo-authored-by: Dario
Gieselaar
<dario.gieselaar@elastic.co>","sha":"181d61723136084ec57801fab1cc99457c047977"}},"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/192544","number":192544,"mergeCommit":{"message":"[inference]
Add simulated function calling (#192544)\n\n## Summary\r\n\r\nAdd
simulated function calling to the inference plugin. For now, only\r\nthe
openAI adapter is supported. This is done by adding a new,
optional\r\n`functionCalling` parameter to the chat and task
APIs\r\n\r\nImplementation was adapted from the equivalent feature in
the o11y\r\nassistant.\r\n\r\n---------\r\n\r\nCo-authored-by: Dario
Gieselaar
<dario.gieselaar@elastic.co>","sha":"181d61723136084ec57801fab1cc99457c047977"}},{"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-minor Backport to (9.0) the previous minor version (i.e. one version back from main) 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 Observability AI Assistant v8.16.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants