CLI to optimize prompts with AWS Bedrock
Project description
Bedrock Prompt Optimizer (bpo)
A CLI wrapper around the Amazon Bedrock Agents Runtime optimize_prompt method, which optimizes prompts for the given model. Checkout available models here.
Installation
To install the Bedrock Prompt Optimizer cli, run:
pip install bpo
Usage
Arguments
--prompt: Path to the input prompt file--output: Path to the output file where the optimized prompt will be saved (default: optimized_prompt.txt)--model-id: Bedrock model ID (default: will prompt to select from a list of models)--region: AWS region (default: us-east-1)--stdout: Print the optimized prompt to stdout instead of saving to a file--clip: Use the last thing copied to clipboard as the input text to optimize
Example
bpo optimize --prompt input.txt --model-id amazon.nova-pro-v1:0 --region us-east-1
This command will:
- Read the prompt from
input.txt - Optimize it
- Save the optimized prompt to
optimized_prompt.txt
bpo optimize --clip --stdout
This command will:
- Read the text from the last copied item in the clipboard
- Provide a select input to pick a model from (just a subset of available models)
- Optimize it
- Output the optimized prompt to standard output
Notes
- Ensure you have the necessary AWS credentials configured to access the Bedrock service.
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
bpo-0.4.0.tar.gz
(3.2 kB
view details)
File details
Details for the file bpo-0.4.0.tar.gz.
File metadata
- Download URL: bpo-0.4.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce5936fc3195513972bfc8d957991dca69fd0ecd85d42123e9f06f19bb21b959
|
|
| MD5 |
7ea8f34a97915f208753dbcaf91f7aab
|
|
| BLAKE2b-256 |
91628e4a77a65dd10b68f66e7d1f4f056a25dce1aadd9686a77c6ef7616d2b8f
|