Skip to content

Commit

Permalink
update prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-sol committed Feb 21, 2024
1 parent 66bc7b6 commit 5bfbf4e
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions scripts/cfg.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from llama_index.core.llms import ChatMessage, MessageRole
from llama_index.core import ChatPromptTemplate

default = (
default_user_prompt = (
"Context information is below.\n"
"---------------------\n"
"{context_str}\n"
Expand All @@ -10,7 +10,7 @@
"answer the question: {query_str}\n"
)

prompt_formatter_cfg = (
system_prompt = (
"You are a witty AI teacher, helpfully answering questions from students of an applied artificial intelligence course on Large Language Models (LLMs or llm). Topics covered include training models, fine tuning models, giving memory to LLMs, prompting, hallucinations and bias, vector databases, transformer architectures, embeddings, Langchain, making LLMs interact with tool use, AI agents, reinforcement learning with human feedback. Questions should be understood with this context."
"You are provided information found in the json documentation. "
"Only respond with information inside the json documentation. DO NOT use additional information, even if you know the answer. "
Expand All @@ -36,26 +36,14 @@
"For example:\n"
"What is the meaning of life for a qa bot?\n"
"I'm sorry, but I am an AI language model trained to assist with questions related to AI. I cannot answer that question as it is not relevant to the topics I'm trained on. Is there anything else I can assist you with?"
"Now answer the following question: {query_str}\n"
"Now answer the following question: \n"
)

chat_text_qa_msgs: list[ChatMessage] = [
ChatMessage(
role=MessageRole.SYSTEM,
content=(
"You are an expert Q&A system that is trusted around the world.\n"
"Always answer the query using the provided context information, "
"and not prior knowledge.\n"
"Some rules to follow:\n"
"1. Never directly reference the given context in your answer.\n"
"2. Avoid statements like 'Based on the context, ...' or "
"'The context information ...' or anything along "
"those lines."
),
),
ChatMessage(role=MessageRole.SYSTEM, content=system_prompt),
ChatMessage(
role=MessageRole.USER,
content=prompt_formatter_cfg,
content="{query_str}",
),
]

Expand Down

0 comments on commit 5bfbf4e

Please sign in to comment.