Skip to content

Commit

Permalink
clean up README, fix some spelling mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
npiv committed Mar 20, 2023
1 parent 4a24ce6 commit 4ce2873
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -8,7 +8,7 @@ Chatblade is a versatile command-line interface (CLI) tool designed to interact
You can do that by either passing `--openai-api-key KEY` or by setting an env variable `OPENAI_API_KEY` (recommended). The examples below all assume an env variable is set.

### Install
on linux like systems you should be able to just checkout the project and `pip install .`
On Linux-like systems, you should be able to just check out the project and run `pip install .`.

## Some Examples

Expand Down Expand Up @@ -50,7 +50,7 @@ The piped input is placed above the query and sent to ChatGPT. In this example,

<img src="assets/example3.png">

### Check token count and estimaed costs
### Check token count and estimated costs
If you want to check the approximate cost and token usage of a previous query, you can use the `-t` flag for "tokens."

```bash
Expand All @@ -59,19 +59,19 @@ curl https://news.ycombinator.com/rss | chatblade given the above rss can you sh

<img src="assets/example4.png">

this won't perform any action over the wire, and just calculates the tokens locally
This won't perform any action over the wire, and just calculates the tokens locally.

### Make custom prompts

We can also save common prompt configs for easy reuse. Any yaml file we place under ~/.config/chatblade/ will be picked up by the command.

So for example given the following yaml called `etymology.yaml`, and which contains:
So for example, given the following yaml called `etymology.yaml`, which contains:
```yaml
system: |-
I want you to act as a professional Etomologist and Quiz Generator. You have a deep knowledge of etymology and will be provided with a word.
I want you to act as a professional Etymologist and Quiz Generator. You have a deep knowledge of etymology and will be provided with a word.
The goal is to create cards that quiz on both the etymology and finding the word by its definition.
The following is a what a perfect answer would like for the word "disparage"
The following is what a perfect answer would look like for the word "disparage":
[{
"question": "A verb used to indicate the act of speaking about someone or something in a negative or belittling way.<br/> <i>E.g He would often _______ his coworkers behind their backs.</i>",
Expand All @@ -90,15 +90,15 @@ system: |-
Only answer in JSON, don't provide any more text. Valid JSON uses "" quotes to wrap its items.
```

we can now run a command and refer to this prompt with `-p etymology`
We can now run a command and refer to this prompt with `-p etymology`:

```bash
chatblade -p etymology gregarious
```

<img src="assets/example5.png">

And since we asked for json we can pipe our result to something else e.g.
And since we asked for JSON, we can pipe our result to something else, e.g.:

```bash
chatblade -l -e > toanki
Expand All @@ -117,7 +117,7 @@ positional arguments:
options:
-h, --help show this help message and exit
--last, -l Display the last result. If a query is given the conversation is continued
--last, -l Display the last result. If a query is given, the conversation is continued
--prompt-config PROMPT_CONFIG, -p PROMPT_CONFIG
Prompt config name, or file containing a prompt config
--openai-api-key OPENAI_API_KEY
Expand All @@ -126,7 +126,7 @@ options:
Temperature (openai setting)
--chat-gpt {3.5,4}, -c {3.5,4}
Chat GPT model (default 3.5)
--extract, -e Extract content from response if possible (either json or code block)
--extract, -e Extract content from response if possible (either JSON or code block)
--raw, -r print the last response as pure text, don't pretty print or format
--tokens, -t Display what *would* be sent, how many tokens, and estimated costs
```

0 comments on commit 4ce2873

Please sign in to comment.