Skip to main content

No project description provided

Project description

Write Quality Prompts

Use and evaluate prompting techniques quickly.

QualityPrompts implements 58 prompting techniques explained in this survey from OpenAI, Microsoft, et al.

1. Install Quality Prompts:

pip install quality-prompts

2. Write the components of your prompt

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 knowledge graph in..."

prompt = QualityPrompt(
                        directive,
                        additional_information,
                        output_formatting,
                        exemplar_store
                       )

3. QualityPrompts 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)

4. Simply call one of several prompting techniques to your prompt

System2Attention
prompt.system2attention(input_text)
print(prompt.compile())
>> You are given a document and your task is to create a knowledge graph from it.
        
In the knowledge graph, entities such as people, places, objects, institutions, topics, ideas, etc. are represented as nodes.
Whereas the relationships and actions between them are represented as edges.

Example input: Cardiovascular disease (CVD) encompasses a spectrum of...
Example output: [{'entity': 'cardiovascular disease (cvd)', 'connections': ...

You will respond with a knowledge graph in the given JSON format:

[
    {"entity" : "Entity_name", "connections" : [
        {"entity" : "Connected_entity_1", "relationship" : "Relationship_with_connected_entity_1},
        {"entity" : "Connected_entity_2", "relationship" : "Relationship_with_connected_entity_2},
        ]
    },
]

Tabular Chain of Thought Prompting

prompt.tabular_chain_of_thought_prompting(input_text=input_text)
print(prompt.compile())
Solve the given math problem.
Think through the problem step by step to solve it.
At each step, you have to figure out:
- the step number,
- the sub-question to be answered in that step,
- the thought process of solving that step, and
- the result of solving that step.
Respond in the following markdown table format for each step:
|step|subquestion|process|result|    

6. Upcoming: Easily evaluate different prompting techniques

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quality-prompts-0.0.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

quality_prompts-0.0.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file quality-prompts-0.0.3.tar.gz.

File metadata

  • Download URL: quality-prompts-0.0.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for quality-prompts-0.0.3.tar.gz
Algorithm Hash digest
SHA256 8e67bd99cfe51b0b9fb20b83c3749283340d320aed9f8aff93fe9bfba747f14e
MD5 4bdcf5f5207c9406eb0cf849ece22553
BLAKE2b-256 8c5c9b9ac7f988e36d58c0f50653b2c8ea7fb55d8ff5be3341782434981a51df

See more details on using hashes here.

File details

Details for the file quality_prompts-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for quality_prompts-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 212dff3a4bc7efa0819178d732e01544a26dd334db6f99b7c824ce00f9cc9cb7
MD5 689bf0a0f70b26b8cee19cd206cfc04a
BLAKE2b-256 b58b6684dde47872637149d2f81f82eb33698bab00aec6222ab622541859dea5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page