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 details)

Uploaded Source

Built Distribution

prompt_wrangler-0.5.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file prompt_wrangler-0.5.0.tar.gz.

File metadata

  • Download URL: prompt_wrangler-0.5.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for prompt_wrangler-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8b24efb04baca6549ac2b43559ecc6459c9b2b0fa62983886b52fc59dec6b97d
MD5 79ad62790af089a9b730a350bc6ecb5b
BLAKE2b-256 14e7e33b5af8603a2af4071eabf4651ba58c6fc63a0d7775d57e6e5d6e4fc693

See more details on using hashes here.

File details

Details for the file prompt_wrangler-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prompt_wrangler-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e832a2994a7795597c335f0e0b7e61c7ecb6d4f7d150c2f67ac7bdd00b604ee
MD5 790ae47139e59c486ff85f0f4c9013d2
BLAKE2b-256 cdc0ca2df87cbbe5479c9a93fc8a61c3dcbd25e6358df5aa37d465e1a12ff15e

See more details on using hashes here.

Supported by

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