Skip to content

Commit b7ee1a9

Browse files
committed
Update README
1 parent 3310fd1 commit b7ee1a9

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

README.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,38 @@
22

33
<h3 align="center">Supports OpenAI, DeepInfra, Google, Hyperbolic, and others</h3>
44

5-
## Installation
5+
## Key Features
6+
7+
You can convert text to speech (tts) and play it from the command line:
68

79
```sh
8-
cargo install trf
10+
$ export OPENAI_KEY="$(grep 'OPENAI_KEY' .env | cut -d= -f2)"
11+
12+
$ cat myfile.txt | trf tts | vlc - --intf dummy
913
```
1014

11-
## Usage Examples
15+
You can also chat with an LLM:
16+
17+
```sh
18+
$ export DEEPINFRA_KEY="$(grep 'DEEPINFRA_KEY' .env | cut -d= -f2)"
19+
20+
$ echo "This is a test. Respond with 'hello world'." | trf chat
21+
hello world
22+
```
1223

13-
Text to speech:
24+
## Installation
1425

1526
```sh
16-
$ OPENAI_KEY="$(cat /path/to/key)"; cat myfile.txt | trf tts --output=myfile.mp3
27+
cargo install trf
1728
```
1829

19-
Chat:
30+
or via [`cargo-binstall`](https://github.com/cargo-bins/cargo-binstall):
2031

2132
```sh
22-
$ DEEPINFRA_KEY="<KEY>"; echo "hi there" | trf chat
33+
cargo binstall trf
2334
```
2435

36+
2537
## More Examples
2638

2739
### Text to Speech in Bash

src/chat.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub(crate) async fn chat(args: &ChatArgs, key: &transformrs::Key, input: &str) {
5454
// Ensure the output is printed immediately.
5555
std::io::stdout().flush().unwrap();
5656
}
57+
println!();
5758
} else {
5859
let resp = transformrs::chat::chat_completion(&provider, key, &model, &messages)
5960
.await

0 commit comments

Comments
 (0)