Skip to content

Commit 3dc094f

Browse files
committed
repl complete
1 parent 99a77d6 commit 3dc094f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ some text in markdown format for you to use summarize:
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.
4141

42+
You can run it in an interactive mode or as a script. To run it interactively, run `promptlab` with no arguments. You then enter commands at the prompt as if you were using the CLI.
43+
44+
![promptlab interactive](misc/promptlab-repl.png)
45+
4246
Finally, Promptlab can be used as part of a script to automate the process of generating prompts and responses. For example, here's an example of how tou might summarize the full contents of a book:
4347

4448
```bash
@@ -88,7 +92,7 @@ Finally, you can use the `dump` command to write the results to a file, or trans
8892

8993
Once you've found the right set of transformations and filters, you can script the whole process to automate the generation of prompts and responses and save it as a bash script.
9094

91-
Note that promptlab isn't meant to be a production tool -- it's mostly for exploratoy work to figure out how to structure your data and what prompts are effective for whatever you're trying to do. Once you've figured that out, it's likely that you would want to condense those operations into a single program that you can run at scale
95+
Note that promptlab isn't meant to be a production tool -- it's mostly for exploratoy work to figure out how to structure your data and what prompts are effective for whatever you're trying to do. Once you've figured that out, it's likely that you would want to condense those operations into a single program that you can run at scale.
9296

9397
# Command Reference
9498

@@ -437,7 +441,7 @@ From the root directory, run the following command:
437441
438442
```
439443

440-
pyinstaller -F \
444+
pyinstaller \
441445
--name=promptlab \
442446
--add-data="sql:sql" \
443447
--hidden-import=prompt_toolkit \

main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,9 @@ def action_dump_prompts():
645645
# *****************************************************************************************
646646
def define_arguments(argString=None):
647647

648-
parser = ArgumentParser(description="Mangage prommpts across long blocks of text")
648+
parser = ArgumentParser(
649+
description="Mangage prommpts across long blocks of text", exit_on_error=False
650+
)
649651
parser.add_argument(
650652
"action",
651653
choices=ACTIONS,
@@ -846,6 +848,9 @@ def process_command():
846848
session = PromptSession()
847849
while True:
848850
argString = session.prompt("promptlab> ")
851+
# If the user just hits enter, skip parsing because it will exit the program
852+
if len(argString) == 0:
853+
continue
849854
if argString == "exit":
850855
break
851856
try:

misc/promptlab-repl.png

893 KB
Loading

0 commit comments

Comments
 (0)