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 setOPENAI_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prompt_wrangler-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e832a2994a7795597c335f0e0b7e61c7ecb6d4f7d150c2f67ac7bdd00b604ee |
|
MD5 | 790ae47139e59c486ff85f0f4c9013d2 |
|
BLAKE2b-256 | cdc0ca2df87cbbe5479c9a93fc8a61c3dcbd25e6358df5aa37d465e1a12ff15e |