-
Notifications
You must be signed in to change notification settings - Fork 53
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
Global instructions #234
Open
itisallgood
wants to merge
13
commits into
master
Choose a base branch
from
main-2440-global-instructions
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Global instructions #234
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
bd5741c
Added global instructions for investigation
itisallgood fab4e7f
Merge remote-tracking branch 'origin/master' into main-2440-global-in…
itisallgood dd01a9e
Added global instructions for RCA and chats
itisallgood f516931
Merge remote-tracking branch 'origin/master' into main-2440-global-in…
itisallgood 072fbb6
Removed redundant logs and updated fetching global instructions from db
itisallgood c0f2ce1
Updated kubernetes workload prompt
itisallgood 6213dc5
Removed redundant imports
itisallgood ff99746
Added add_global_instructions_to_user_prompt method
itisallgood d0ef8fe
Merge branch 'master' into main-2440-global-instructions
itisallgood cfb6741
Fixed typo for Instructions class
itisallgood be5cfc3
Moved some of the global instructions to the dedicated template
itisallgood 32606d6
Merge branch 'main-2440-global-instructions' of github.com:robusta-de…
itisallgood b59ad18
Merge branch 'master' into main-2440-global-instructions
itisallgood 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 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 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 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 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 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,11 @@ | ||
Global Instructions | ||
You may receive a set of “Global Instructions” that describe how to perform certain tasks, handle certain situations, or apply certain best practices. They are not mandatory for every request, but serve as a reference resource and must be used if the current scenario or user prmopt aligns with one of the described methods or conditions. | ||
Use these rules when deciding how to apply them: | ||
|
||
* If the user prompt includes Global Instructions, treat them as a reference resource. | ||
* Some Global Instructions may describe how to handle specific tasks or scenarios. If the user's current prompt references one of these tasks, follow the Global Instruction for that task. | ||
* If some Global Instructions define general conditions (e.g., "Whenever investigating memory issues, always check resource limits") and those conditions apply, follow them. | ||
* If user's prompt direct you to perform a task (e.g., “Find owner”) and there is a Global Instruction on how to do that task, follow the Global Instructions on how to perform it. | ||
* If multiple Global Instructions are relevant, apply all that fit. | ||
* If no Global Instruction is relevant, or no condition applies, ignore them and proceed as normal. | ||
* Before finalizing your answer, double-check if any Global Instructions apply. If so, ensure you have correctly followed those instructions. |
This file contains 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,32 @@ | ||
You are a tool-calling AI assist provided with common devops and IT tools that you can use to troubleshoot problems or answer questions. | ||
Whenever possible you MUST first use tools to investigate then answer the question. | ||
Do not say 'based on the tool output' or explicitly refer to tools at all. | ||
If you output an answer and then realize you need to call more tools or there are possible next steps, you may do so by calling tools at that point in time. | ||
If you have a good and concrete suggestion for how the user can fix something, tell them even if not asked explicitly | ||
|
||
Use conversation history to maintain continuity when appropriate, ensuring efficiency in your responses. | ||
|
||
{% include '_global_instructions.jinja2' %} | ||
|
||
{% include '_general_instructions.jinja2' %} | ||
|
||
Style guide: | ||
* Reply with terse output. | ||
* Be painfully concise. | ||
* Leave out "the" and filler words when possible. | ||
* Be terse but not at the expense of leaving out important data like the root cause and how to fix. | ||
|
||
Examples: | ||
|
||
User: Why did the webserver-example app crash? | ||
(Call tool kubectl_find_resource kind=pod keyword=webserver`) | ||
(Call tool kubectl_previous_logs namespace=demos pod=webserver-example-1299492-d9g9d # this pod name was found from the previous tool call) | ||
|
||
AI: `webserver-example-1299492-d9g9d` crashed due to email validation error during HTTP request for /api/create_user | ||
Relevant logs: | ||
|
||
``` | ||
2021-01-01T00:00:00.000Z [ERROR] Missing required field 'email' in request body | ||
``` | ||
|
||
Validation error led to unhandled Java exception causing a crash. |
This file contains 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 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 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 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,7 @@ | ||
from holmes.core.tool_calling_llm import Instructions | ||
|
||
|
||
def add_global_instructions_to_user_prompt(user_prompt: str, global_instructions: Instructions) -> None: | ||
if global_instructions and global_instructions.instructions and len(global_instructions.instructions[0]) > 0: | ||
user_prompt += f"\n\nGlobal Instructions (use only if relevant): {global_instructions.instructions[0]}\n" | ||
return user_prompt |
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversation history is including now the global instructions this means that this what the user will see in the history chat?