prompt-template
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Create predefined prompt templates for large language models in typescript to save your users time and effort!

Description

Prompt Template Generator is a TypeScript NPM package designed to help you create dynamic and customizable prompt templates. This is especially useful for crafting dialogues with AI, simplifying user experiences, and enhancing the ease of text generation.

Installation

Install this package using npm:

npm i prompt-template

Usage

Here is an example of how you can use this package:

import { PromptTemplate } from 'prompt-template-generator';

const myTemplate = new PromptTemplate(['name', 'age'], 'My name is {name} and I am {age} years old.');
console.log(myTemplate.generatePrompt({ name: 'John Doe', age: '30' }));

const anotherTemplate = new PromptTemplate(['topic'], 'Tell me more about {topic}.');
console.log(anotherTemplate.generatePrompt({ topic: 'AI technology' }));

Features

  • Dynamic Prompt Generation: Create prompt templates with placeholders that can be replaced with your own data.
  • Flexible Templating: Supports a diverse range of variable types, not just strings.

Contributing

We appreciate all contributions. Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

Package Sidebar

Install

npm i prompt-template

Weekly Downloads

2

Version

1.0.3

License

MIT License

Unpacked Size

4.74 kB

Total Files

8

Last publish

Collaborators

  • josharsh