Skip to content

Commit c36eab5

Browse files
committed
chore: release v0.8.0
1 parent 601a513 commit c36eab5

File tree

3 files changed

+41
-64
lines changed

3 files changed

+41
-64
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aichat"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
edition = "2021"
55
authors = ["sigoden <[email protected]>"]
66
description = "A powerful chatgpt cli."

README.md

Lines changed: 39 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
[![CI](https://github.com/sigoden/aichat/actions/workflows/ci.yaml/badge.svg)](https://github.com/sigoden/aichat/actions/workflows/ci.yaml)
44
[![Crates](https://img.shields.io/crates/v/aichat.svg)](https://crates.io/crates/aichat)
55

6-
Chat with gpt-3.5/chatgpt in terminal.
6+
Using ChatGPT/GPT-3.5/GPT-4 in the terminal.
77

8-
![demo](https://user-images.githubusercontent.com/4012553/223645914-f397b95f-1a30-4eda-a6a8-5bd0c2903add.gif)
8+
AIChat in chat mode:
9+
10+
![chat mode](https://user-images.githubusercontent.com/4012553/226499667-4c6b261a-d897-41c7-956b-979b69da5982.gif)
11+
12+
AIChat in command mode:
13+
14+
![command mode](https://user-images.githubusercontent.com/4012553/226499595-0b536c82-b039-4571-a077-0c40ad57f7db.png)
915

1016
## Install
1117

@@ -21,13 +27,14 @@ Download it from [Github Releases](https://github.com/sigoden/aichat/releases),
2127

2228
## Features
2329

30+
- Support chat and command modes
2431
- Predefine AI [roles](#roles)
2532
- Use GPT prompt easily
2633
- Powerful [Chat REPL](#chat-repl)
2734
- Context-ware conversation
28-
- syntax highlighting markdown and other 200 languages.
35+
- syntax highlighting markdown and other 200 languages
2936
- Stream output with hand typing effect
30-
- Multiline input support and emacs-like editing experience
37+
- Support multiple models
3138
- Support proxy
3239
- Support dark/light theme
3340
- Save chat messages
@@ -48,12 +55,15 @@ After setting, it will automatically create the configuration file. Of course, y
4855

4956
```yaml
5057
api_key: "<YOUR SECRET API KEY>" # Request via https://platform.openai.com/account/api-keys
58+
organization_id: "org-xxx" # optional, set organization id
59+
model: "gpt-3.5-turbo" # optional, choose a model
5160
temperature: 1.0 # optional, see https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
5261
save: true # optional, If set true, aichat will save chat messages to message.md
5362
highlight: true # optional, Set false to turn highlight
5463
proxy: "socks5://127.0.0.1:1080" # optional, set proxy server. e.g. http://127.0.0.1:8080 or socks5://127.0.0.1:1080
5564
conversation_first: false # optional, If set true, start a conversation immediately upon repl
5665
light_theme: false # optional, If set true, use light theme
66+
connect_timeout: 10 # optional, Set a timeout in seconds for connect to gpt.
5767
```
5868
5969
> You can use `.info` to view the current configuration file path and roles file path.
@@ -66,7 +76,7 @@ We can let ChatGPT play a certain role through `prompt` to make it better genera
6676

6777
We can predefine a batch of roles in `roles.yaml`.
6878

69-
> We can get the location of `roles.yaml` through the `.info` command.
79+
> We can get the location of `roles.yaml` through the repl's `.info` command or cli's `--info` option.
7080

7181
For example, we define a role
7282

@@ -76,68 +86,18 @@ For example, we define a role
7686
I want you to act as a linux shell expert.
7787
I want you to answer only with bash code.
7888
Do not provide explanations.
79-
# temperature: 0.3
8089
```
8190

8291
Let ChatGPT answer questions in the role of a linux shell expert.
8392
```
8493
〉.role shell
8594

8695
shell〉 extract encrypted zipfile app.zip to /tmp/app
87-
---
8896
mkdir /tmp/app
8997
unzip -P PASSWORD app.zip -d /tmp/app
90-
---
91-
```
92-
93-
We have provided many [Role Examples](https://github.com/sigoden/aichat/wiki/Role-Examples).
94-
95-
## CLI
96-
97-
```
98-
A powerful chatgpt cli.
99-
100-
Usage: aichat [OPTIONS] [TEXT]...
101-
102-
Arguments:
103-
[TEXT]... Input text
104-
105-
Options:
106-
-p, --prompt <PROMPT> Set a GPT prompt
107-
-H, --no-highlight Disable syntax highlightiing
108-
-S, --no-stream No stream output
109-
--list-roles List all roles
110-
-r, --role <ROLE> Select a role
111-
-h, --help Print help
112-
-V, --version Print version
113-
```
114-
### Command mode
115-
116-
```sh
117-
aichat math 3.8x4
118-
```
119-
120-
control highlighting and streaming
121-
122-
```sh
123-
aichat how to post a json in rust # highlight, streaming output
124-
aichat -H -S how to post a json in rust # no highlight, output all at once
125-
```
126-
127-
pipe input/output
128-
```sh
129-
# convert toml to json
130-
cat data.toml | aichat turn toml below to json > data.json
13198
```
132-
### Chat mode
13399
134-
Enter Chat REPL if no text input.
135-
```
136-
$ aichat
137-
Welcome to aichat 0.5.0
138-
Type ".help" for more information.
139-
140-
```
100+
We have provided many awesome [Role Examples](https://github.com/sigoden/aichat/wiki/Role-Examples).
141101
142102
## Chat REPL
143103
@@ -152,7 +112,7 @@ The Chat REPL supports:
152112
- Undo support
153113
- Clipboard integration
154114
155-
### multi-line editing mode
115+
### multi-line editing
156116
157117
**Type `{` or `(` at the beginning of the line to enter the multi-line editing mode.** In this mode you can type or paste multiple lines of text. Type the corresponding `}` or `)` at the end of the line to exit the mode and submit the content.
158118
@@ -174,6 +134,7 @@ The Chat REPL supports:
174134
〉.help
175135
.info Print the information
176136
.set Modify the configuration temporarily
137+
.model Choose a model
177138
.prompt Add a GPT prompt
178139
.role Select a role
179140
.clear role Clear the currently selected role
@@ -186,7 +147,6 @@ The Chat REPL supports:
186147

187148
Type `{` to enter the multi-line editing mode, type '}' to exit the mode.
188149
Press Ctrl+C to abort readline, Ctrl+D to exit the REPL
189-
190150
```
191151
192152
### `.info` - view current configuration information.
@@ -197,23 +157,35 @@ config_file /home/alice/.config/aichat/config.yaml
197157
roles_file /home/alice/.config/aichat/roles.yaml
198158
messages_file /home/alice/.config/aichat/messages.md
199159
api_key sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
160+
organization_id -
161+
model gpt-3.5-turbo
200162
temperature -
201163
save true
202164
highlight true
203165
proxy -
204166
conversation_first false
205167
light_theme false
168+
connect_timeout 10
206169
dry_run false
207170
```
208171
209172
### `.set` - modify the configuration temporarily
210173
211174
```
175+
〉.set dry_run true
212176
〉.set highlight false
213177
〉.set save false
214178
〉.set temperature 1.2
215179
```
216180
181+
### `.model` - choose a model
182+
183+
```
184+
> .model gpt-4
185+
> .model gpt-4-32k
186+
> .model gpt-3.5-turbo
187+
```
188+
217189
### `.prompt` - use GPT prompt
218190
219191
When you set up a prompt, every message sent later will carry the prompt.
@@ -234,7 +206,7 @@ Done
234206
🙈😳
235207
```
236208
237-
`.prompt` actually creates a temporary role called `%TEMP%` internally, so **run `.clear role` to clear the prompt**.
209+
`.prompt` actually creates a temporary role internally, so **run `.clear role` to clear the prompt**.
238210
239211
When you are satisfied with the prompt, add it to `roles.yaml` for later use.
240212
@@ -286,14 +258,19 @@ You can run `.conversation` to enter context-aware mode, or set `config.conversa
286258
2
287259
1
288260

289-
$.clear conversation 4043
290-
291-
292261
```
293262
294263
When enter conversation mode, prompt `〉` will change to `$`, A number will appear on the right, which means how many tokens left to use.
295264
Once the number becomes zero, you need to start a new conversation.
296265
266+
Exit conversation mode
267+
268+
```
269+
$.clear conversation 4043
270+
271+
272+
```
273+
297274
## License
298275
299276
Copyright (c) 2023 aichat-developers.

0 commit comments

Comments
 (0)