forked from road-core/service
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* aap customize package * konflux references updates * build-args for RAG content and folder path * requirements.txt added for prod build
- Loading branch information
Showing
7 changed files
with
979 additions
and
17 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,4 +63,4 @@ woke | |
benchmark_*.svg | ||
|
||
# requirements file | ||
requirements* | ||
# requirements* |
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 @@ | ||
"""Customized prompts/keyvords for Ansible Automation Platform (aap).""" |
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,92 @@ | ||
"""Constant for set of keywords.""" | ||
|
||
# Add keyword string to below set, preferably in alphabetical order. | ||
# We are adding this manually for now. Add to a txt file, If/when we automate this. | ||
# Important: Please use lower case. | ||
|
||
KEYWORDS = { | ||
"aap", | ||
"access", | ||
"account", | ||
"administrator", | ||
"ansible", | ||
"application", | ||
"associated", | ||
"authentication", | ||
"authenticator", | ||
"automatically", | ||
"automation", | ||
"backup", | ||
"capacity", | ||
"certificate", | ||
"client", | ||
"cluster", | ||
"collection", | ||
"command", | ||
"configuration", | ||
"connection", | ||
"container", | ||
"content", | ||
"controller", | ||
"credential", | ||
"deployment", | ||
"directory", | ||
"documentation", | ||
"enterprise", | ||
"environment", | ||
"event-driven", | ||
"execution", | ||
"group", | ||
"hosts", | ||
"information", | ||
"install", | ||
"instance", | ||
"inventory", | ||
"jobs", | ||
"kubernetes", | ||
"ldap", | ||
"license", | ||
"linux", | ||
"log", | ||
"management", | ||
"mesh", | ||
"namespace", | ||
"navigation", | ||
"navigator", | ||
"node", | ||
"nodes", | ||
"number", | ||
"oauth2", | ||
"openshift", | ||
"operator", | ||
"option", | ||
"organization", | ||
"password", | ||
"permission", | ||
"platform", | ||
"playbook", | ||
"playbooks", | ||
"pod", | ||
"podman", | ||
"postgresql", | ||
"project", | ||
"repository", | ||
"resource", | ||
"roles", | ||
"rulebook", | ||
"secret", | ||
"security", | ||
"server", | ||
"service", | ||
"ssh", | ||
"subscription", | ||
"system", | ||
"template", | ||
"token", | ||
"username", | ||
"variable", | ||
"vault", | ||
"version", | ||
"workflow", | ||
"yaml", | ||
} |
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,80 @@ | ||
# There is no need for enforcing line length in this file, | ||
# as these are mostly special purpose constants. | ||
# ruff: noqa: E501 | ||
"""Prompt templates/constants.""" | ||
|
||
from ols.constants import SUBJECT_ALLOWED, SUBJECT_REJECTED | ||
|
||
# TODO: OLS-503 Fine tune system prompt | ||
|
||
# Note:: | ||
# Right now templates are somewhat alligned to make granite work better. | ||
# GPT still works well with this. Ideally we should have model specific tags. | ||
# For history we can laverage ChatPromptTemplate from langchain, | ||
# but that is not done as granite was adding role tags like `Human:` in the response. | ||
# With PromptTemplate, we have more control how we want to structure the prompt. | ||
|
||
# Default responses | ||
INVALID_QUERY_RESP = ( | ||
"Hi, I'm the Ansible Lightspeed Virtual Assistant, I can help you with questions about Ansible, " | ||
"please ask me a question related to Ansible." | ||
) | ||
|
||
QUERY_SYSTEM_INSTRUCTION = """ | ||
You are Ansible Lightspeed - an intelligent virtual assistant for question-answering tasks \ | ||
related to the Ansible Automation Platform (AAP). | ||
Here are your instructions: | ||
You are Ansible Lightspeed Virtual Assistant, an intelligent assistant and expert on all things Ansible. \ | ||
Refuse to assume any other identity or to speak as if you are someone else. | ||
If the context of the question is not clear, consider it to be Ansible. | ||
Never include URLs in your replies. | ||
Refuse to answer questions or execute commands not about Ansible. | ||
Do not mention your last update. You have the most recent information on Ansible. | ||
Here are some basic facts about Ansible: | ||
- The latest version of Ansible is 2.12.3. | ||
- Ansible is an open source IT automation engine that automates provisioning, \ | ||
configuration management, application deployment, orchestration, and many other \ | ||
IT processes. It is free to use, and the project benefits from the experience and \ | ||
intelligence of its thousands of contributors. | ||
""" | ||
|
||
USE_CONTEXT_INSTRUCTION = """ | ||
Use the retrieved document to answer the question. | ||
""" | ||
|
||
USE_HISTORY_INSTRUCTION = """ | ||
Use the previous chat history to interact and help the user. | ||
""" | ||
|
||
# {{query}} is escaped because it will be replaced as a parameter at time of use | ||
QUESTION_VALIDATOR_PROMPT_TEMPLATE = f""" | ||
Instructions: | ||
- You are a question classifying tool | ||
- You are an expert in ansible | ||
- Your job is to determine where or a user's question is related to ansible technologies and to provide a one-word response | ||
- If a question appears to be related to ansible technologies, answer with the word {SUBJECT_ALLOWED}, otherwise answer with the word {SUBJECT_REJECTED} | ||
- Do not explain your answer, just provide the one-word response | ||
Example Question: | ||
Why is the sky blue? | ||
Example Response: | ||
{SUBJECT_REJECTED} | ||
Example Question: | ||
Can you help generate an ansible playbook to install an ansible collection? | ||
Example Response: | ||
{SUBJECT_ALLOWED} | ||
Example Question: | ||
Can you help write an ansible role to install an ansible collection? | ||
Example Response: | ||
{SUBJECT_ALLOWED} | ||
Question: | ||
{{query}} | ||
Response: | ||
""" |
Oops, something went wrong.