Prompts

Cheatsheet

Summarize

  • Summarize the text delimited by triple dashes into a single sentence. --- [text] ---

  • Summarize the meeting notes in a single paragraph. Then write a markdown list of the speakers and each of their key points. Finally, list the next steps or action items suggested by the speakers, if any.

  • Summarize the text delimited by triple quotes with a haiku.

  • Summarize the text delimited by triple quotes in about 50 words.

  • Summarize the text delimited by triple quotes in 2 paragraphs.

  • Summarize the text delimited by triple quotes in 3 bullet points.

  • You will be provided with a pair of articles (delimited with XML tags) about the same topic. First summarize the arguments of each article. Then indicate which of them makes a better argument and explain why.

Grammar & Spellcheck

  • Correct the grammar of the following sentence. [sentence]

  • Correct the grammar of the following sentence. If there are multiple correct options, give them in a numbered list. [sentence]

  • Proofread and correct the following text and rewrite the corrected version. If you don't find any errors, just say "No errors found". Don't use any punctuation around the text: ---[text]---

  • proofread and correct this review. Make it more compelling. Ensure it follows APA style guide and targets an advanced reader. Output in markdown format. Text: {text}

Translate

  • Translate from English to Chinese. [sentence]

  • Translate the following English text to Spanish: """Hi, I would like to order a blender."""

  • Tell me which language this is: """Combien coûte le lampadaire?"""

  • Translate the following text to French, Spanish and English pirate

  • Translate the following from slang to a business letter:

  • Translate the following text that is delimited by triple backticks into a style that is American English in a calm and respectful tone. text: ```{text}```

Output formatting

  • [...] Give the final answer as a valid JSON.

  • [...] Give your answer as either yes or no.

  • [...] Provide your output in json format with the key: primary and secondary, etc.

  • [...] Output a single character.

Transformation

  • Translate the following python dictionary from JSON to an HTML table with column headers and title: {data_json}

    • from IPython.display import display, Markdown, Latex, HTML, JSON display(HTML(response))

Few-shot learning

involves providing an LLM with a few examples of a task to help it understand the context and nuances of the problem. It is particularly useful for tasks that require a certain tone, syntax, or style, and for fields where the language used is specific to a particular domain

chevron-rightExample-1 Simplehashtag
chevron-rightExample-2 Detect prompt injectionhashtag

Calculation

  • How do I add up a row of dollar amounts in Excel? I want to do this automatically for a whole sheet of rows with all the totals ending up on the right in a column called "Total".

  • Write a Python function to efficiently calculate the Fibonacci sequence. Comment the code liberally to explain what each piece does and why it's written that way.

Persona or Role

  • Answer this question as if you were a rude store attendant. Question: where are the carrots?

chevron-rightDefault Rolehashtag
chevron-rightUsing role to Control context, length, and combined hashtag

Moderation & Detect Prompt injection

  • Use openai Moderation API

  • Use delimiters to guard against malicious prompt injection

chevron-rightDelimiters and Guard against Prompt injectionhashtag

Inference

Use cases: extracting labels, extracting names, sentiment analysis, etc.

chevron-rightSentimenthashtag

Extract

Use cases: extract information from text

chevron-rightExtract information from text hashtag

Classification

chevron-rightUse case: Customer service assistanthashtag

Task: classify many different instructions to handle different cases

Chain of Thought Reasoning

chevron-rightUse case: Customer product inquiry, ask directlyhashtag
chevron-rightUse case: Customer product inquiry, using few-shot reasoninghashtag

Use case: answer the customer query using the provided product list

chevron-rightUse case: Customer product inquiry, combine product info for external sourcehashtag

NOTE: there are also more advanced techniques for information retrieval (i.e., filtered_product_info). One of the most effective ways to retrieve information is using text embeddings. And embeddings can be used to implement efficient knowledge retrieval over a large corpus to find information related to a given query. One of the key advantages of using text embeddings is that they enable fuzzy or semantic search, which allows you to find relevant information without using the exact keywords. So in our example, we wouldn't necessarily need the exact name of the product, but we could do a search with a more general query like a mobile phone.

QA Validation

References

Last updated