Skip to content

Commit 535d6b0

Browse files
committed
improved readme
1 parent c6d41b0 commit 535d6b0

File tree

1 file changed

+30
-49
lines changed

1 file changed

+30
-49
lines changed

README.md

Lines changed: 30 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Promptlab is a utility for managing common activities when processing large amou
77
- Filter out blocks of text. For example, you might only want to process one chapter in a book.
88
- Apply templated prompts to your blocks and send them to an LLM. You can use metadata in your prompts to make them more dynamic. For example, you might have a metadata file with keys like `title`, `author`, and `topic`. You can include these keys in your prompt templates.
99

10-
Propmptlab helps you massage text into blocks that can be fed into an LLM using a [Jinja](https://jinja.palletsprojects.com/) template. This template contains the text of your prompt, along with variables that get passed in from the block. For example, you might have a template like this with three variables -- a topic, a title, an authos, and a block of text:
10+
Propmptlab helps you massage text into smaller blocks that can be fed into an LLM using a [Jinja](https://jinja.palletsprojects.com/) template. This template contains the text of your prompt, along with variables that get passed in from the block. For example, you might have a template like this with three variables -- a topic, a title, an authos, and a block of text:
1111

1212
```
1313
You are a technical instructional designer who is reviewing
@@ -20,21 +20,21 @@ markdown format for you to use summarize:
2020

2121
You supply the metadata in a YAML file, like this:
2222

23-
```
23+
```yml
2424
title: Fooing the Bar
2525
topic: Python Programming
2626
author: A. N. Other
2727
```
2828
2929
When you run the `prompt` command in Promptlab, a block of text and the metadata is passed into the template:
3030

31-
```
31+
```jinja
3232
You are a technical instructional designer who is reviewing
3333
a book about Python Programming called Fooing the Bar by A. N. Other.
3434
Your job is to summarize the key points in each section. Here is
3535
some text in markdown format for you to use summarize:
3636
37-
<A BLOCK OF TEXT FROM PROMPTLAB>
37+
<BLOCK OF TEXT>
3838
```
3939

4040
This fully rendered text is sent to an LLM for completion. The process is repeated for the other blocks of content until all the sections you select are processed. You can then convert these resposes into new blocks or metadata, or just dump them out an save them in a file.
@@ -75,11 +75,10 @@ Promptlab has the following commands:
7575
- `set-group` -- set the current group
7676
- `prompt` -- generate prompts from a set of blocks based on metadata and a template
7777
- `prompts` -- list all prompts
78-
- `transfer-prompts`
79-
- `merge-prompts-into-block`
80-
- `version`
81-
- `set-api-key`
82-
- `dump`
78+
- `transfer-prompts` -- convert prompts into blocks or metadata
79+
- `version` - show the version of the software
80+
- `set-api-key` - set the api key used for the LLM
81+
- `dump` - write blocks or prompts to standard output
8382

8483
## `init`
8584

@@ -352,45 +351,51 @@ Transfer prompts to metadata:
352351
promptlab transfer-prompts --to=metadata --metadata_key=key-points
353352
```
354353
355-
## Metadata
354+
## `version`
356355
357-
### Global metadata
356+
Prints the version of the software.
358357
359-
A file of metadata values you want to use:
358+
### Examples
360359
360+
```
361+
promptlab version
361362
```
362363
363-
title: Designing Data Intensive Applications
364-
topic: data science
365-
author: Some dude
364+
## `set-api-key`
366365
367-
```
366+
Sets the API key used for the LLM. This is required to use the `prompt` command. NB: This key is stored in plain text in a file called `~/.promptlab`.
368367
369-
These keys can then be used in a template, like this:
368+
### Examples
370369
370+
```
371+
promptlab set-api-key
371372
```
372373
373-
{{title}}
374+
# Development
374375
375-
Has the topic {{topic}} written by {{author}}.
376+
This section is a little light right now since this is a single person project. I should probably write some tests, for example....
376377
377-
{{block}}
378+
## Set up the environment
378379
380+
```
381+
python -m venv .venv
379382
```
380383
381-
You include the metadata file using the `--globals` when your create your prompts:
384+
To activate:
382385
386+
```
387+
source .venv/bin/activate
383388
```
384389
385-
promptlab prompt --fn=myprompt.jinja --globals=data.yml
390+
To deactivate:
386391
387392
```
388-
389-
# Development
393+
deactivate
394+
```
390395
391396
## Building standalone executable
392397
393-
First, be sure you're set up to run pyinstaller by reading [Build an executable with pyinstaller](http://www.gregreda.com/2023/05/18/notes-on-using-pyinstaller-poetry-and-pyenv/). This is another good [tutorial on pyinstaller](https://www.devdungeon.com/content/pyinstaller-tutorial).
398+
First, be sure you're set up to run pyinstaller by reading [Build an executable with pyinstaller](http://www.gregreda.com/2023/05/18/notes-on-using-pyinstaller-poetry-and-pyenv/). This is another good [tutorial on pyinstaller](https://www.devdungeon.com/content/pyinstaller-tutorial). It took a bit of finagling to make this work, so YMMV.
394399
395400
From the root directory, run the following command:
396401
@@ -402,27 +407,3 @@ pyinstaller -F \
402407
main.py
403408

404409
```
405-
406-
# venv
407-
408-
```
409-
410-
python -m venv .venv
411-
412-
```
413-
414-
To activate:
415-
416-
```
417-
418-
source .venv/bin/activate
419-
420-
```
421-
422-
To deactivate:
423-
424-
```
425-
426-
deactivate
427-
428-
```

0 commit comments

Comments
 (0)