[9.1] [Obs AI Assistant] Inject user prompt before tool call when query actions are clicked (#227462)#227643
Merged
kibanamachine merged 1 commit intoelastic:9.1from Jul 11, 2025
Conversation
…ions are clicked (elastic#227462) Closes elastic/obs-ai-team#309 ## Summary This PR improves the `Display Results` and `visualize this query` actions by injecting a user prompt first and then the tool call to maintain correct message ordering. This fixes the empty message that was observed when visualize this query was clicked. However, in any case, if an empty message is received this should be handled separately to avoid breaking the conversation flow. ## Testing instructions: 1. Generate some logs 2. Pick the LLM (Needs to be tested with Elastic Managed LLM, Claude 3.5, Claude 3.7, GPT-4, etc) 3. Ask the assistant to generate a query 4. Click on `Display results` -- the results should be shown and the user should be able to continue the conversation 5. Click on `Visualize this query` -- the visualization should be shown and the user should be able to continue the conversation ## Traces with each model: - EIS (Visualize this query) - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/b1dcb77fb39ad7efbf82d9c4a1feb0e0?selectedSpanNodeId=U3BhbjoyOTk3ODQ%3D <img width="715" height="868" alt="image" src="https://github.com/user-attachments/assets/75fd8efe-82df-4f7f-ad4f-f915e09d49da" /> - EIS (Display results) - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/e7d8c42774491e6e2bcf328c34203c14?selectedSpanNodeId=U3BhbjozMDAxOTg%3D https://github.com/user-attachments/assets/6aa520db-2b40-4317-ace0-7be206ebb669 - Bedrock+Claude 3.7 - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/f1bc4f490fcc990db9dbddf0782cff7e?selectedSpanNodeId=U3BhbjoyOTk4MDA%3D <img width="709" height="889" alt="image" src="https://github.com/user-attachments/assets/86f77ff9-1783-42d3-8b31-8680fd7da227" /> - Bedrock+Claude 3.5 - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/457a7cc939ce3b18ae3a9e2b066c3a7f?selectedSpanNodeId=U3BhbjoyOTk4MTY%3D <img width="714" height="942" alt="image" src="https://github.com/user-attachments/assets/fe96b72e-24d0-4a85-9b42-a9862bdf4139" /> - AzureOpenAI+GPT 4.1 - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/de9fc09a6f0162b7b2d6f52fbb188469?selectedSpanNodeId=U3BhbjoyOTk4MzI%3D <img width="715" height="877" alt="image" src="https://github.com/user-attachments/assets/cca5326e-9350-426f-9f2e-a407d26e193d" /> - Gemini 2.0 Flash - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/982da6b0ff4bae04f45af0271aa4cd84?selectedSpanNodeId=U3BhbjoyOTk4NTI%3D <img width="709" height="880" alt="image" src="https://github.com/user-attachments/assets/d29b99c7-e3f6-4318-a19b-0a92e7aa690b" /> - Gemini 2.5 Flash - https://35-187-109-62.sslip.io/projects/UHJvamVjdDo5/traces/9f7115cc79bb2e929dbeb93670555e81?selectedSpanNodeId=U3BhbjoyOTk4NjU%3D <img width="708" height="872" alt="image" src="https://github.com/user-attachments/assets/4c6e48fd-ccaf-413c-b01d-21c0fc8df061" /> ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. (cherry picked from commit 021b308)
Merged
2 tasks
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
💚 Build Succeeded
Metrics [docs]Async chunks
Historycc @viduni94 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.1:Questions ?
Please refer to the Backport tool documentation