Quality Prompts implements 58 prompting techniques explained in this survey from the University of Maryland in collaboration with researchers from Learn Prompting, OpenAI, Microsoft, etc.
pip install quality-prompts
from quality_prompts.prompt import QualityPrompt
directive = "You are given a document and your task..."
additional_information = "In the knowledge graph, ..."
output_formatting = "You will respond with a ..."
prompt = QualityPrompt(
directive,
additional_information,
output_formatting,
exemplar_store
)
3. Quality Prompts searches and uses only the few-shot examples that are relevant to the user's query
input_text = "list the disorders included in cvd"
prompt.few_shot(input_text=input_text, n_shots=1)
Helps clarify the given context as an additinoal step before it's used to answer the question
prompt.system2attention(input_text)
Prompts the LLM to think step by step and write the step, process and result of each step in a markdown table. Significantly boosts accuracy in solving math problems.
prompt.tabular_chain_of_thought_prompting(input_text)
To stay updated on the latest evaluation features and prompting techniques added to the library, you can star this repo.