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
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.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a715166b142a00e855253b5b0ea4bef95f2976a454dad86eed3370a66a27a83f |
|
MD5 | 9410afb3e7b908a9e682d03fd27a81be |
|
BLAKE2b-256 | db58c3926062fbb29fd316e82055d6850e87ba09e9fa88d4d4c177cea7517b22 |