Sandbox Setup¶
This page documents setup instructions for any libraries or tools used in the cookbook, in one central location. This enables easier maintenance and consistency in usage.
DevContainer vs. Local Development
Whenever possible, we will recommend usage of a development container setup with the cookbook repo, for fast and reliable starts. For now, we assume you start in a default Codespaces (universal) with no custom setup. If you choose to work in a local development environment, we recommend using a virtual environment (conda or venv).
1. Setup Prompty¶
1.1 Install Package¶
You can installl the stable version of prompty at any time with:
1 |
|
For interim testing, we will use a pre-release prompty-xyz.whl
file that is downloaded to the local folder from its build location. Here the xyz
will map to a specific build or commit version.
1 |
|
1.2 Validate Install¶
Test if the prompty CLI was installed:
prompty --help
Usage: prompty [OPTIONS] [INPUTS]...
Options:
-s, --source TEXT [required]
-e, --env TEXT
-v, --verbose
-c, --chat
--version Show the version and exit.
--help Show this message and exit.
INPUTS: key=value pairs
The values can come from:
- plain strings - e.g.: question="Does it have windows?"
- files - e.g.: question=@question.txt
- stdin - e.g.: question=@-
For more information, visit https://prompty.ai/
2. Test with Extension¶
2.1 Create Asset¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
2.2 Run Asset¶
Open the above asset in VS Code. Press "Play" or F5 inside extension.
3. Test With CLI¶
3.1 Create Asset¶
To test out the default CLI, let's get a starter asset from the Prompty VS Code extension GitHub panel. This is the auto-generated asset for a gpt-4o
model.
gpt-4o.prompty | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
|
3.2 Run Asset¶
Run this command in terminal:
Bash | |
---|---|
1 |
|