-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Obs AI Assistant] Gemini prompt improvements #223476
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
Merged
viduni94
merged 85 commits into
elastic:main
from
viduni94:improve-prompts-for-gemini-models
Aug 11, 2025
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
23c1a47
Gemini prompts
viduni94 3e159ba
Add new prompt with conditions
viduni94 8679aa6
Update prompt based on deployment
viduni94 f5aae43
Remove unnecessary new line
viduni94 6c6ea27
Alerts function
viduni94 9569a46
Elasticsearch function prompt tweaks
viduni94 07904a1
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 42d77c4
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 f81358f
Improve system prompt for generating ES|QL
SrdjanLL 4015d54
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 38f247f
Merge branch 'main' into improve-prompts-for-gemini-models
SrdjanLL 59b9f68
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 18f3c1e
Prompt tunning for APM scenarios
SrdjanLL d5c2906
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 ebe6a7f
Re-factor system prompt
viduni94 5dcbe60
Set "context" tool as non-internal in order to fix knowledge base ret…
SrdjanLL eac2764
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 5de47ff
Additional system prompt changes
SrdjanLL 8b614a4
Make context tool internal again and use its function name from "comm…
SrdjanLL 4b9ebd7
A few more refactors
viduni94 21e641d
Remove *query tools from the system prompt
SrdjanLL e8d73af
Improve KB retrieval
viduni94 55735ff
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 72d032f
Update tool name
viduni94 266979f
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 e7dd784
Add instructions to the NL-ES|QL system prompt specific to the query …
SrdjanLL 02ca4a4
Move documentation tool instruction to the system prompt to fix instr…
viduni94 a2d9067
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 6000089
Update prompt for get_apm_downstream_dependancies to not enforce time…
viduni94 5eec8e1
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 a1db93c
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 66f77d1
Fix import
viduni94 9f8b85c
Fix import
viduni94 fa05b5f
Fix import
viduni94 41775e0
Fix import
viduni94 8dfe250
Fix import
viduni94 8a257af
System message updates for the NL-ESQL task
SrdjanLL ce7f83e
Append and emphasize available tools to the additional system instruc…
SrdjanLL 83b918c
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 bcc053b
Fix import
viduni94 d828edf
Update tests
viduni94 fba0980
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 a6574e3
Fix import
viduni94 77abce8
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 050b37b
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 167bc1b
Dial down the eagerness for query execution in example scenarios
SrdjanLL be1138c
Refactor system prompt to reorder function usage guideliness for gett…
SrdjanLL 18f91f1
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 f1f1b91
System prompt updates: remove hardcoded numbered list of core princip…
SrdjanLL 065eba5
Fix index patern for trace duration ES|QL evaluation scenario as disc…
SrdjanLL 4ed3281
Update system prompt with clearer query requirements. Update tool des…
SrdjanLL bcb9f3a
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 82eda46
Fix search prompt to inlcude tool instructions
viduni94 952ef2d
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 7dda9c7
Use tags in the system prompt instead of markdown section titles
viduni94 f4e7497
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 1f46084
Fix test
viduni94 2710076
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 cca3105
Improve documentation scenario criteria
viduni94 f996a7a
Change APM scenario back to success rate
viduni94 70dbd9e
Update formatting of the system prompt
viduni94 a3892d0
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 749f315
Tweak the system promot for better discoverability of the index name
viduni94 85d24e2
Update ES|QL instructions
viduni94 930ba2e
Improve instructions for time range handling and alerts
viduni94 4ebc616
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 179e8a1
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 d46b55a
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 a71c1d9
Improve instructions for the ES tool to disallow some actions
viduni94 b682dfb
Add snapshot tests
viduni94 2366166
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 0122059
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 218351e
Fix i18n
viduni94 d008e38
Fix typo
viduni94 8437ff6
Update snapshots
viduni94 c918222
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 daaa0f1
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 a03ef08
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 5e2f90d
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 57a44b2
Small prompt tweak for time range handling
viduni94 61c0732
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 1db394b
Update prompt snapshots
viduni94 8edf472
Merge branch 'main' into improve-prompts-for-gemini-models
viduni94 13bc13f
Fix merge conflict
viduni94 51e38ff
Remove extra ES tool instruction from merging main
viduni94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
44 changes: 44 additions & 0 deletions
44
x-pack/platform/plugins/shared/observability_ai_assistant/common/function_names.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0; you may not use this file except in compliance with the Elastic License | ||
| * 2.0. | ||
| */ | ||
|
|
||
| // Context tools | ||
| export const CONTEXT_FUNCTION_NAME = 'context'; | ||
| export const GET_DATA_ON_SCREEN_FUNCTION_NAME = 'get_data_on_screen'; | ||
|
|
||
| // Alerts tools | ||
| export const GET_ALERTS_DATASET_INFO_FUNCTION_NAME = 'get_alerts_dataset_info'; | ||
| export const ALERTS_FUNCTION_NAME = 'alerts'; | ||
|
|
||
| // Query tools | ||
| export const QUERY_FUNCTION_NAME = 'query'; | ||
| export const EXECUTE_QUERY_FUNCTION_NAME = 'execute_query'; | ||
| export const VISUALIZE_QUERY_FUNCTION_NAME = 'visualize_query'; | ||
|
|
||
| // Dataset tools | ||
| export const GET_DATASET_INFO_FUNCTION_NAME = 'get_dataset_info'; | ||
| export const SELECT_RELEVANT_FIELDS_NAME = 'select_relevant_fields'; | ||
|
|
||
| export const ELASTICSEARCH_FUNCTION_NAME = 'elasticsearch'; | ||
|
|
||
| export const EXECUTE_CONNECTOR_FUNCTION_NAME = 'execute_connector'; | ||
|
|
||
| export const KIBANA_FUNCTION_NAME = 'kibana'; | ||
|
|
||
| export const SUMMARIZE_FUNCTION_NAME = 'summarize'; | ||
|
|
||
| export const CHANGES_FUNCTION_NAME = 'changes'; | ||
|
|
||
| export const RETRIEVE_ELASTIC_DOC_FUNCTION_NAME = 'retrieve_elastic_doc'; | ||
|
|
||
| // APM tools | ||
| export const GET_APM_DATASET_INFO_FUNCTION_NAME = 'get_apm_dataset_info'; | ||
| export const GET_APM_DOWNSTREAM_DEPENDENCIES_FUNCTION_NAME = 'get_apm_downstream_dependencies'; | ||
| export const GET_APM_SERVICES_LIST_FUNCTION_NAME = 'get_apm_services_list'; | ||
|
|
||
| // Deprecated tools | ||
| export const GET_APM_TIMESERIES_FUNCTION_NAME = 'get_apm_timeseries'; | ||
| export const LENS_FUNCTION_NAME = 'lens'; |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.