Skip to main content

A unix pipeline utility based on LLM

Project description

nlpip A unix pipeline utils based on LLM

nlpip takes a text written in natural language as input, and performs a specified command also written in natural language, and then outputs the result in natural language.

Here's a demo:

screen recording

Installation

First, you need to install nlpip using pip:

pip install nlpip

Then, you need to obtain your OpenAI's API key and set it as an environment variable:

export OPENAI_API_KEY=WRITE_YOUR_KEY_HERE

How to use

nlpip or just nlp for short, provides following default commands:

  • keywords: Extract keywords from input text
  • poem: Write poem using input text
  • summarize: Summarize input text
  • sentiment: Analyze sentiment of input text

For example, if you want summarize input.txt and turn it into a poem, you can run the following command:

cat input.txt | nlp summarize | nlp poem

How to create a new command

To create a new command, you just need to create a text file containing the command in natural language. For example, if you want to create a command that translates input text into French, you can create a file named ~/.nlpip/prompts/fr.txt in with:

Translate into French

Then, you can run the following command:

echo Hello | nlp fr

And you will get the following output:

Bonjour

You may override default commands by creating a file with the same name in ~/.nlpip/prompts/.

Credit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nlpip-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

nlpip-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file nlpip-0.1.0.tar.gz.

File metadata

  • Download URL: nlpip-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for nlpip-0.1.0.tar.gz
Algorithm Hash digest
SHA256 410afb488a2b6c15605c3edb743b15d0349b02c5f02f326de78980b58710ba80
MD5 324de76e13fefcb1619b7b01f15d6531
BLAKE2b-256 48a1ae6f7a5680bfaba5495679d9879f7115f05d7acf33c4b0b020b4c7c5eec3

See more details on using hashes here.

File details

Details for the file nlpip-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nlpip-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for nlpip-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25bddf2afcff948659521730bf12edb13702351451c51ca88f95394c476affed
MD5 504f91ee167b5eba9dcccab62408a265
BLAKE2b-256 90da2f1e70289cfcb437778668613870f5c8a883dc8ab1281d4f4af5ea742c31

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page