Skip to content

Comments

[Obs AI Assistant] Collapse *query tool calls#226078

Merged
dgieselaar merged 20 commits intoelastic:mainfrom
dgieselaar:collapse-query-tools
Jul 4, 2025
Merged

[Obs AI Assistant] Collapse *query tool calls#226078
dgieselaar merged 20 commits intoelastic:mainfrom
dgieselaar:collapse-query-tools

Conversation

@dgieselaar
Copy link
Contributor

@dgieselaar dgieselaar commented Jul 1, 2025

This PR improves tool calling when using Claude as LLM

@dgieselaar dgieselaar force-pushed the collapse-query-tools branch from 1614dc2 to c836b2a Compare July 2, 2025 08:14
@arturoliduena
Copy link
Contributor

arturoliduena commented Jul 3, 2025

@sorenlouv sorenlouv added the ci:project-deploy-observability Create an Observability project label Jul 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@sorenlouv
Copy link
Member

/oblt-deploy

@sorenlouv sorenlouv marked this pull request as ready for review July 3, 2025 22:25
@sorenlouv sorenlouv requested review from a team as code owners July 3, 2025 22:25
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Jul 3, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16079637606

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16079639517

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 4, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3215416)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.0:
- [Obs AI Assistant] [Anonymization] Update system prompt to inform about anonymization (#224211)
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 226078

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jul 4, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3215416)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.18 Backport failed because of merge conflicts
8.19 Backport failed because of merge conflicts
9.0 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.0:
- [Obs AI Assistant] [Anonymization] Update system prompt to inform about anonymization (#224211)
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 226078

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 4, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [[Obs AI Assistant] Collapse *query tool calls
(#226078)](#226078)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-04T19:03:41Z","message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Obs
AI Assistant] Collapse *query tool
calls","number":226078,"url":"https://github.com/elastic/kibana/pull/226078","mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","8.18","9.0"],"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/226078","number":226078,"mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@dgieselaar dgieselaar deleted the collapse-query-tools branch July 7, 2025 06:56
adcoelho pushed a commit to adcoelho/kibana that referenced this pull request Jul 7, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@dgieselaar
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.18

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

Questions ?

Please refer to the Backport tool documentation

dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jul 7, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3215416)

# Conflicts:
#	x-pack/platform/packages/shared/kbn-inference-tracing/src/with_chat_complete_span.ts
#	x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts
#	x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.ts
#	x-pack/platform/plugins/shared/observability_ai_assistant/common/convert_messages_for_inference.ts
#	x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
#	x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/operators/continue_conversation.ts
#	x-pack/platform/plugins/shared/stack_connectors/server/connector_types/bedrock/bedrock.ts
#	x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/ai_assistant/complete/functions/execute_query.spec.ts
dgieselaar added a commit to dgieselaar/kibana that referenced this pull request Jul 7, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3215416)
dgieselaar added a commit that referenced this pull request Jul 7, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [[Obs AI Assistant] Collapse *query tool calls
(#226078)](#226078)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-04T19:03:41Z","message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Obs
AI Assistant] Collapse *query tool
calls","number":226078,"url":"https://github.com/elastic/kibana/pull/226078","mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226656","number":226656,"state":"MERGED","mergeCommit":{"sha":"73495c5b24ec87b10df4e43e8a082c9132d9461a","message":"[9.1]
[Obs AI Assistant] Collapse *query tool calls (#226078) (#226656)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.1`:\n- [[Obs AI Assistant] Collapse *query tool
calls\n(#226078)](https://github.com/elastic/kibana/pull/226078)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Søren
Louv-Jansen <soren.louv@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/226078","number":226078,"mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
dgieselaar added a commit that referenced this pull request Jul 7, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Obs AI Assistant] Collapse *query tool calls
(#226078)](#226078)

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@neptunian
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

neptunian pushed a commit to neptunian/kibana that referenced this pull request Jul 10, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 3215416)

# Conflicts:
#	x-pack/platform/plugins/shared/observability_ai_assistant/common/convert_messages_for_inference.ts
#	x-pack/platform/plugins/shared/observability_ai_assistant/server/service/client/index.ts
#	x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts
#	x-pack/test/api_integration/deployment_agnostic/apis/observability/ai_assistant/complete/functions/execute_query.spec.ts
neptunian added a commit that referenced this pull request Jul 10, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Obs AI Assistant] Collapse *query tool calls
(#226078)](#226078)

<!--- Backport version: 10.0.1 -->

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

<!--BACKPORT [{"author":{"name":"Dario
Gieselaar","email":"dario.gieselaar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-04T19:03:41Z","message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0","v8.18.4","v9.0.4"],"title":"[Obs
AI Assistant] Collapse *query tool
calls","number":226078,"url":"https://github.com/elastic/kibana/pull/226078","mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},"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/226656","number":226656,"state":"MERGED","mergeCommit":{"sha":"73495c5b24ec87b10df4e43e8a082c9132d9461a","message":"[9.1]
[Obs AI Assistant] Collapse *query tool calls (#226078) (#226656)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.1`:\n- [[Obs AI Assistant] Collapse *query tool
calls\n(#226078)](https://github.com/elastic/kibana/pull/226078)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Dario Gieselaar <dario.gieselaar@elastic.co>\nCo-authored-by: Søren
Louv-Jansen <soren.louv@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/226078","number":226078,"mergeCommit":{"message":"[Obs
AI Assistant] Collapse *query tool calls (#226078)\n\nThis PR improves
tool calling when using Claude as LLM\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"3215416fa60f6b99017b0172797ea257bde62e5e"}},{"branch":"8.18","label":"v8.18.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226780","number":226780,"state":"MERGED","mergeCommit":{"sha":"d08efa2303f8a9e4ae090c7d44b6f3a6ee19bce9","message":"[8.18]
[Obs AI Assistant] Collapse *query tool calls (#226078) (#226780)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.18`:\n- [[Obs AI Assistant] Collapse *query tool
calls\n(#226078)](https://github.com/elastic/kibana/pull/226078)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/226852","number":226852,"state":"MERGED","mergeCommit":{"sha":"c5d7606a4b7f197651d0e8779094fd4cf96775b4","message":"[9.0]
[Obs AI Assistant] Collapse *query tool calls (#226078) (#226852)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.0`:\n- [[Obs AI Assistant] Collapse *query tool
calls\n(#226078)](https://github.com/elastic/kibana/pull/226078)\n\n---------\n\nCo-authored-by:
Søren Louv-Jansen <soren.louv@elastic.co>\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine <elasticmachine@users.noreply.github.com>"}}]}]
BACKPORT-->

Co-authored-by: Dario Gieselaar <dario.gieselaar@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
This PR improves tool calling when using Claude as LLM

---------

Co-authored-by: Søren Louv-Jansen <soren.louv@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants