Skip to main content

A Python wrapper for the Prompt Wrangler REST API.

Project description

Prompt Wrangler

A Python wrapper for the Prompt Wrangler REST API.

Easily integrate large language models (LLMs) into your app with Prompt Wrangler! Prompt Wrangler makes it simple to incorporate LLMs into your application and enhance your prompts without updating your code. Best of all, it's 100% free!

Installation

Install the package using pip:

pip install prompt-wrangler

Usage

from prompt_wrangler import PromptWrangler

api_key = "<your_api_key>"
workspace = "<your_workspace_slug>"
prompt_wrangler = PromptWrangler(api_key, workspace)

Replace <your_api_key> with your actual API key.

To add a new prompt, use the prompt method with the prompt slug:

prompt_slug = "reason-next-web-command"
prompt = prompt_wrangler.prompt(prompt_slug)

To run the prompt, use the run method, optionally passing a dictionary of arguments:

args = {'input_text': 'some input'}
result = prompt.run(args=args)

The run method returns a Prediction object with the prediction value:

print(result.prediction)  # Output: <prediction_value>

License

This project is licensed 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

prompt_wrangler-0.3.0.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

prompt_wrangler-0.3.0-py3-none-any.whl (6.6 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