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

Environment Variables

Before you need to set environment variables.

If you want to use private prompts from your workspace you should set:

PROMPT_WRANGLER_API_KEY=<your_api_key>

If you want to use public prompts from the community you should set:

OPENAI_API_KEY=<open_ai_api_key>

Note that if you set your PROMPT_WRANGLER_API_KEY you don't need to set OPENAI_API_KEY as it will be used as a fallback.

Usage

from prompt_wrangler import PromptWrangler

# Create a PromptWrangler instance
pw = PromptWrangler()

# Get a prompt
prompt_path = "my-workspace/my-prompt-slug"
prompt = prompt_wrangler.prompt(prompt_path)

# Run the prompt
args = {'input_text': 'some input'}
result = prompt.run(args=args)
prediction = result.prediction

License

This project is licensed under the MIT License.

Local Development

Publish

Run. Username is exit38

./publish.sh

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.5.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

prompt_wrangler-0.5.0-py3-none-any.whl (7.1 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