2.1.0 • Published 1 year ago

prompt-tag v2.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

prompt-tag

A prompt optimizer function designed as a tagged template literal.

Overview

Takes a template literal string and any number of arguments. The function tokenizes and stems the first literal string, then iterates over the arguments and appends them to the tokenized and stemmed string along with their synonyms (if any are found).

Usage

Simple:

import { prompt } from 'prompt-tag'

const res = await prompt`Take me on a journey to the ${'beautiful'} places in the ${'galaxy'}`
// tak me on a journey to the{beautiful,pleasant}plac in the{galaxy,collection,aggregation,accumulation,assemblage}

Using arrays:

const actions = ['write', 'advertising']
const styles = ['outdoor recreation', 'summertime']
const places = ['alaska', 'montana']
const reasons = ['new shoe model']
const got = await prompt`${actions} for all ${styles} and ${places} because of ${reasons}`
console.log(got)

// {write,advertising,create_by_mental_act,create_mentally,commercial_enterprise,business_enterprise,business}∀{outdoor recreation,summertime,outdoor recreation,season,time_of_year}∪{alaska,montana,American_state,American_state}∵ of{new shoe model,new shoe model}

See tests for more examples.

Author

2.1.0

1 year ago

2.0.0

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago