Skip to main content

No project description provided

Project description

InstructPrompt 📝🔍

⚡ A Python package for storing, retrieving, and dynamically creating prompts for GPT models ⚡

Our goal with InstructPrompt is to make it easier to tame large language models and make improving your LLM in production simpler to do. This package allows users to store instructions, which can be retrieved to dynamically create prompts giving gpt instructions on how to respond to a specific user's query.

Getting Started

To get started with InstructPrompt, you will need to first install the library by running the following command:

pip install InstructPrompt

Once installed, you can import it into your python project by running the following:

import InstructPrompt

Using InstructPrompt

InstructPrompt provides 3 main functions: add(), list_instructions(), and query_instructions().

add()

The add() function takes in an instruction as a string and adds it to the collection. It uses ChromaDB to store the instruction and assigns it a unique id. It returns a confirmation message once the instruction is successfully added.

import InstructPrompt

instruction = "Please provide the customer's name and order number."

InstructPrompt.add(instruction)

list_instructions()

The list_instructions() function returns a list of all the stored instructions in the collection.

import InstructPrompt

instructions = InstructPrompt.list_instructions()
print(instructions) # Outputs a list of all the stored instructions

query_instructions()

The query_instructions() function takes in a query as a string and returns a list of instructions that match the query. It uses ChromaDB to perform the query and returns up to 5 matching instructions.

import InstructPrompt

query = "How do I reset my password?"

instructions = InstructPrompt.query_instructions(query)
print(instructions) # Outputs a list of instructions that match the query

Version

The current version of InstructPrompt is 0.1.0.

Contributing

We welcome contributions to InstructPrompt! Feel free to create issues/PR's/or DM us (👋 Hi I'm Krrish - +17708783106)

License

InstructPrompt is released under the MIT License.

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

instructprompt-0.1.1.tar.gz (1.9 kB view hashes)

Uploaded Source

Built Distribution

instructprompt-0.1.1-py3-none-any.whl (2.3 kB view hashes)

Uploaded Python 3

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