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 add_prompt
method with the prompt slug:
prompt_slug = "reason-next-web-command"
prompt = prompt_wrangler.add_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.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f731beca54839ec35dc84af54417b7ae57ca94a44f45c8c84d9a76ee83c76f |
|
MD5 | 222f22c24ec7412e6cf357df4ea3a582 |
|
BLAKE2b-256 | 31adf580d77a36936fa29a931ff0351f01f130cae84553ad836ce8e926b10128 |