Skip to contents

Construct a prompt to summarize a paper

Usage

build_prompt_preprint(
  title,
  abstract,
  nsentences = 2L,
  instructions = c("I am giving you a paper's title and abstract.",
    "Summarize the paper in as many sentences as I instruct.",
    "Do not include any preamble text to the summary",
    "just give me the summary with no preface or intro sentence.")
)

Arguments

title

The title of the paper.

abstract

The abstract of the paper.

nsentences

The number of sentences to summarize the paper in.

instructions

Instructions to the prompt. This can be a character vector that gets collapsed into a single string.

Value

A string containing the prompt.

Examples

build_prompt_preprint(title="A great paper", abstract="This is the abstract.")
#> [1] "I am giving you a paper's title and abstract. Summarize the paper in as many sentences as I instruct. Do not include any preamble text to the summary just give me the summary with no preface or intro sentence.\nNumber of sentences in summary: 2\nTitle: A great paper\nAbstract: This is the abstract."