npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gpt-prompt-kit

v1.1.2

Published

Help you better prompt by using prompt engineering technique like external interpreter, chain of thought.

Downloads

22

Readme

GPTPromptKit 📚

Get Format DATA(Like JSON) from GPT! GPTPromptKit is a library that helps developers interact with AI language models more effectively by using prompt engineering techniques. The library offers several techniques that can be used depending on the situation, improving the clarity and accuracy of prompts, and enabling more effective communication with users.

repo: gpt-prompt-kit

Features 🎁

  1. Translate 🌐 : Ask questions in a clear and concise manner to improve translation accuracy.
  2. Format (Text Normalization) 📝: Use a specific format to prompt the user with two available options:
    • JSON: Provide a JSON schema and input, and receive output in this format.
    • Free: Specify any desired format and receive output accordingly.
  3. ChainOfThought 🤔: Prompt GPT to think through the problem step by step.(Coming soon)

Installation 📦

Install GPTPromptKit using npm:

npm install gpt-prompt-kit

Usage 🚀

Create a new file named index.js and add the following code:

import { GPTPromptKit, gptPromptKitFactory } from 'gpt-prompt-kit';

// custom your prompt function to create a gPTPromptKit instance.
const prompt = (text) => {
  // Your function to send the text to GPT and receive a response
};

const gptPromptKit = new GPTPromptKit(prompt);

// or you can just pass API_KEY to use the build-in GPT-3.5 model

const gptPromptKit = gptPromptKitFactory(API_KEY);

// Example usage:
// Translate
const translate = gptPromptKit.translate(Lang.English, Lang.Chinese);
translate('Hello, world!').then(console.log);

// Format JSON
const formatJson = gptPromptKit.formatJson({ key: 'explain it', key2: 'explain it' });
formatJson('Description here', { key: 'example' }).then(console.log);

// Format Free
const formatFree = gptPromptKit.formatFree('Any format template you want');
formatFree('Description here').then(console.log);

Demo 🥸

In demo directory there are some use demo for you to test the abilities of this library.

To use those demo:

  1. Install dependencies:
npm install
  1. Compile & Run the demo:
tsc demo/translate.ts
node demo/translate.js

Translate

translator translator

Format JSON

You can get a JSON string with any fields you want:

formatJson formatJson

Format Free

formatFree formatFree

Changelog 📝

1.1.1

  • delete interpreter so that browser also can use this library.
  • add customize option for gptPromptKitFactory. Now we can use different GPT model. customizedOptions

Development 🛠️

To contribute to GPTPromptKit, follow these steps:

  1. Clone the repository and install dependencies:
git clone https://github.com/clean99/gpt-prompt-kit.git
cd gpt-prompt-kit
npm install
  1. Build the project:
npm run build
  1. Test the project:
npm test
  1. Lint the project:
npm run lint
  1. Format the project:
npm run format

Contributing 🤝

We welcome contributions to GPTPromptKit! If you'd like to contribute, please fork the repository, create a new branch, make your changes, and submit a pull request.

License 📄

GPTPromptKit is licensed under the MIT License.


Feel free to modify the code snippets, installation, usage, and contributing sections as necessary to match your library's actual implementation and requirements.