All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tri.ai.prompt.resources.prompts.yaml Maven / Gradle / Ivy

The newest version!
# Library of prompts
#
# Usage:
#  - preconfigured prompt file in "prompts.yaml" in promptkt
#  - custom prompt file in "prompts.yaml" in the current directory
#
# Syntax:
#  - mustache templates: https://mustache.github.io/mustache.5.html
#  - double braces to insert text {{...}}
#  - triple braces to insert text without escaping HTML {{{...}}}
#
# Keywords:
#  - many templates expect {{input}} and/or {{instruct}}
#  - {{today}} is always replaced with the current date
#
---
chat-back: |
  You are role-playing as {{person}} talking about {{topic}} with {{other persons}} {{setting}}.
  Your response should be what they might say {{script}} and have a {{tone}} tone.

entity-extraction: |
  Extract content from the given text. The result should be a list of {{mode}}{{#format}} formatted as {{format}}{{/format}}. 
  ```
  {{{input}}}
  ```

example-color: |
  Create a 6-digit CSS code (e.g. `#808080`) for a color like the following text.
  text: {{input}}
  background-color: #

example-emoji: |
  Text: I love you
  Emoji: ❤️
  Text: Star Wars
  Emoji: 💫 🗡
  Text: {{input}}
  Emoji:

generate-list: |
  Generate a list from the input text based on the provided list, as a JSON with four parts:
    1. "item_category": copy the category provided
    2. "known_items": copy the list of items provided
    3. "items_in_input": list of items found in or related to the input text -- they must be an item in the given category, and should be underlying/higher-level concepts as appropriate
    4. "new_items": anything in the list of found items that is not in "known_items", along with a reason for their inclusion (leave empty if there are no new items)
  New items should be substantially different than existing ones (not just alternate word form). They should follow the style conventions of "known_items" (e.g. spacing, punctuation, case, etc.).
  
  EXAMPLE
  
  input text:
  ```
  The quick brown fox jumps over the lazy dog.
  ```
  item_category: types of animals
  known_items: ["fox", "cat", "bird"]
  output:
  ```
  {
    "item_category": "types of animals",
    "known_items": ["fox", "cat", "bird"],
    "items_in_input": [ "fox", "dog" ],
    "new_items": {
      "dog": "A dog is another kind of animal in the text."
    }
  }
  ```
  
  input text:
  ```
  {{{input}}}
  ```
  item_category: {{item_category}}
  known_items: {{known_items}}
  output:

generate-list-basic: |
  Generate a list from the input text based on the provided list, as a JSON with two parts:
    1. "item_category": copy the category provided
    2. "items_in_input": list of items found in or related to the input text -- they must be an item in the given category, and should be underlying/higher-level concepts as appropriate
  Use provided sample items where possible.
  
  EXAMPLE
  
  input text:
  ```
  The quick brown fox jumps over the lazy dog.
  ```
  item_category: types of animals
  sample_items: ["fox", "cat", "bird"]
  output:
  ```
  {
    "item_category": "types of animals",
    "items_in_input": [ "fox", "dog" ]
  }
  ```
  
  input text:
  ```
  {{{input}}}
  ```
  item_category: {{item_category}}
  sample_items: {{known_items}}
  output:

image-describe-basic: Describe the image.

image-describe-caption: Generate a caption for the image.

image-describe-detailed: Describe everything you see in this image. Provide a detailed list of contents.

image-describe-json: Convert the image into a JSON object describing its contents.

image-describe-json-graph: |
  Convert the image into a JSON object describing its contents and relationships.
  Example:
  ```
  {
    "items": [ ... ],
    "relationships": [ ... ]
  }
  ```

image-describe-outline: Create a markdown outline of the image contents.


prompt-validate: |
  Determine whether the following is true or false. If it is false, provide a corrected version.
  ```
  {{{result}}}
  ```

prompt-validate-json: |
  Determine if the result is valid json. Respond simply "valid" or "invalid".
  ```
  {{{result}}}
  ```

question-answer: |
  Answer the following question about the text below. If you do not know the answer, say you don't know.
  Question: {{{instruct}}}
  ```
  {{{input}}}
  ```
  Answer:

sentiment-classify: |
  Classify the sentiment in this text as {{instruct}}:
  ```
  {{{input}}}
  ```

summarization: |
  Summarize the following{{#audience}}, written for {{audience}}{{/audience}}{{#style}}, in the style of {{style}}{{/style}}{{#format}}, structured as {{format}}{{/format}}:
  ```
  {{{input}}}
  ```

text-to-json: |
  Extract information from the following text:
  ```
  {{{input}}}
  ```
  {{#guidance}}The result should contain {{guidance}}.{{/guidance}}
  The result must be formatted as {{#format}}{{format}}{{/format}}{{^format}}structured data{{/format}}.
  {{#example}}
  The result schema should match the following example:
  ```
  {{{example}}}
  ```
  {{/example}}

traffic-api-request: |
  Today is {{today}}. Convert the following natural language request for traffic information into a JSON object:
  ```
  {{{input}}}
  ```
  The JSON object must conform to the following scheme:
  ```
  {
      "latitude": 40.712776,
      "longitude": -74.005974
  }
  ```

translate-text:
  template-name: Translate
  template-prompt: |
    Translate this text to {{instruct}}:
    ```
    {{{input}}}
    ```

weather-api-request: |
  Today is {{today}}. Convert the following natural language request for weather information into a JSON object:
  ```
  {{{input}}}
  ```
  The JSON object must conform to the following schema:
  ```
  {
      "city": "Boston, MA",
      "date": "2023-03-04"
  }
  ```

weather-response-formatter: |
  Today is {{today}}. Use the following data to answer a user question.
  If the data indicates unknown or nulls, tell the user there was a problem retrieving weather information.
  If you cannot answer the question directly but there is useful weather information in the data, provide a summary of the JSON as a basic weather forecast.
  Question: {{instruct}}
  ```
  {{{input}}}
  ```

wikipedia-page-guess: |
  What is the title of the Wikipedia page that answers the following question? Give a short answer with your best guess.
  Question: How big is Texas?
  Wikipedia Page: Texas
  Question: {{input}}
  Wikipedia Page:

############################
# DOCUMENT Q&A
############################
# view: Document Q&A
# prefix: question-answer-docs-*
# keywords:
#   {{{instruct}}} - question
#   {{{input}}} - document sections

question-answer-docs: |
  Answer the question using the provided excerpts from factual sources.
  Include citations to all sources used, and only those sources.
  List citations used below the response.
  If there is no relevant content, say you don't know.
  
  Example:
  """
  Question:
    What is the capital of the Maryland?
  Answer:
    The capital of Maryland is Annapolis [1], which is a beautiful city on the Chesapeake Bay [2].
  Citations:
    - [1] american_cities.txt
    - [2] the_chesapeake.txt
  """
  
  Question:
    {{{instruct}}}
  Excerpts:
    {{{input}}}
  Answer:

question-answer-docs2: |
  Here is a collection of document sections, to be used for a question below.
  ```
  {{{input}}}
  ```
  Answer the following question based on the given collection of document sections. If you do not know the answer, say you don't know.
  Include numbered citations.
  
  Question: What is the capital of the Maryland?
  
  Answer: The capital of Maryland is Annapolis [1,3], which is a beautiful city on the Chesapeake Bay [2,3].
  
  [1] american_cities.txt
  [2] a_history_of_annapolis.txt
  [3] maryland.txt

  Question: {{{instruct}}}

  Answer: 

question-answer-docs-basic: |
  Answer the following question based on the given collection of document sections. If you do not know the answer, say you don't know.
  Please also indicate the documents used to answer the question.
  Question: {{{instruct}}}
  ```
  {{{input}}}
  ```
  Answer: 

question-answer-docs-basic-dolly: |
  Below is an instruction that includes a user question and some input. Write a response that appropriately completes the request, and if the answer is not contained within the text below, respond with "I can't answer that". Provide numbered citations for your answer.
  
  ### Instruction
  {{{instruct}}}

  Input:
  {{{input}}}

  ### Response

question-answer-docs-basic-falcon: |
  >>INSTRUCTION<<
  Answer the question using the provided text, and if the answer is not contained within the text below, respond with "I can't answer that". Provide numbered citations for your answer.
  >>CONTEXT<<
  {{{input}}}
  >>QUESTION<<
  {{{instruct}}}
  >>ANSWER<<

question-answer-docs-basic-llama: |
  [INST]
  <>
  You are a bot that answers questions succinctly.
  Below is an instruction that includes a user question and some input. Write a response that appropriately completes the request, and if the answer is not contained within the text below, respond with "I can't answer that". Provide numbered citations with your answer. Do not say "Sure" or repeat the question.
  <>
  
  Question:
  ```
  {{{instruct}}}
  ```
  
  Input:
  ```
  {{{input}}}
  ```
  [/INST]
  
  Answer:

question-answer-docs-basic-vicuna: |
  ### System: You are an assistant that answers questions succinctly in English, using the context below. If the answer is not contained within the text below, respond with "I can't answer that". Provide numbered citations with your answer.
  ### Human: Here is the context for my question:
  ```
  {{{input}}}
  ```
  ### Human: {{{instruct}}}
  ### Assistant: 

############################
# TEXT JOINER CONCATENATIONS
############################
# view: Prompt Scripting
# prefix: text-joiner-*
# keywords:
#   {{matches}} - list of items
#   {{{text}}} - text of snippet

text-joiner-basic: |
  {{#matches}}
  {{#prefix}}({{prefix}}){{/prefix}}
  {{{text}}}  
  {{/matches}}

text-joiner-bullets: |
  {{#matches}} 
  - {{#prefix}}({{prefix}}) {{/prefix}}{{{text}}}  
  {{/matches}}
  

############################
# SNIPPET CONCATENATIONS
############################
# view: Document Q&A
# prefix: snippet-joiner-*
# keywords:
#   {{matches}} - list of snippets
#     {{prefix}} - prefix appended before text (e.g. to describe particular content of a document in more detail)
#     {{number}} - number of match (starting at 1)
#     {{name}} - name of snippet in match
#     {{{text}}} - text of snippet in match

snippet-joiner-basic: |
  {{#matches}}
  Document: {{name}}
  {{#prefix}}Description: {{prefix}}{{/prefix}}
  Relevant Text: {{{text}}}
  
  {{/matches}}

snippet-joiner-numbered: |
  {{#matches}}
  - ""{{{text}}}""
    [{{number}}] {{name}}
    {{#prefix}}({{prefix}}){{/prefix}}
  
  {{/matches}}

snippet-joiner-citations: |
  {{#matches}}
  [[Citation {{number}}]] {{name}}
  {{#prefix}}{{prefix}}{{/prefix}}
  """
  {{{text}}}
  """
  
  {{/matches}}

############################
# DOCUMENT MAPPING
############################
# view: Document Insights
# prefix:
#   document-map-* - prompts to run against all snippets
#   document-reduce-* - method to combine results
# keywords:
#   {{{input}}} - text to process

document-map-summarize:
  template-name: Summarize
  template-prompt: |
    Provide a one-line summary of this text.
    ```
    {{{input}}}
    ```

document-map-simplify:
  template-name: Simplify
  template-prompt: |
    Simplify the following text into 1-2 short sentences explaining the main idea. Put it in simple terms with no jargon,
    appropriate for an elementary school student.
    ```
    {{{input}}}
    ```

document-map-math-terms: |
  Generate a JSON list of mathematical concepts in the following text. If there are no mathematical terms, provide an empty list.

  Text:
  ```
  {{{input}}}
  ```
  
  Concepts:

document-reduce-summarize: |
  Create a summary of the following text:
  ```
  {{{input}}}
  ```

document-reduce-outline:
  template-name: Outline
  template-prompt: | 
    Combine the following summaries into an outline.
    ```
    {{{input}}}
    ```

document-reduce-author: |
  Use the following summaries to generate a profile of the author of these texts.
  ```
  {{{input}}}
  ```

document-reduce-math-terms: |
  Combine the following lists of mathematical terms into a single list. Group terms that are synonyms.
  ```
  {{{input}}}
  ```

document-reduce-technical-terms:
  template-name: Technical Terms
  template-prompt: |
    Extract technical terms and tools from the input text into a bulleted list. Group terms that are synonyms.
    Sample output:
    ```
    - Term 1: describe it
    - Term 2: describe it
    ```
    Input:
    ```
    {{{input}}}
    ```

############################
# DOCUMENT GUESSING
############################
# prefix:
#   document-guess-* - takes general text input and extracts specific content
# keywords:
#   {{{input}}} - text to process

document-guess-metadata: |
  The following is text from a PDF or document. Provide a JSON with any document metadata you can infer from the text.
  The result may include:
   - title
   - subtitle
   - authors
   - date (YYYY-MM-DD) -- if there is a clear date of publication
   - keywords (list of strings) -- if there is a stated list of keywords
   - abstract (string) -- omit this if there is not a labeled abstract section
   - executive_summary (string) -- omit this if there is not a labeled executive summary section
   - sections (list of strings) -- values should include both numbers and titles as shown in text, e.g. "1. Introduction" or "2 METHODS"
   - captions (list of strings) -- values should include both figure/table caption number and the caption itself
   - references (list of strings) -- values should be precise bibliographic citations found in any bibliography
   - other (dictionary) -- any other metadata that is clearly stated in the text
  
  Values should be exact matches for the text provided. Use "NONE" or omit the object if a value is not found.
  ```
  {{{input}}}
  ```




© 2015 - 2024 Weber Informatics LLC | Privacy Policy