Commit Graph

258 Commits

Author SHA1 Message Date
sigoden
2539e24fe9
chore: improve code by getting prompt from config (#39) 2023-03-08 17:13:11 +08:00
sigoden
ee81275431
fix: windows no stream output (#37) 2023-03-08 16:17:51 +08:00
sigoden
2a7a6f5f27 chore: no longer ignore any error 2023-03-08 16:06:24 +08:00
sigoden
4e729db237 chore: optimize output newline 2023-03-08 13:58:50 +08:00
sigoden
f694a59dcc
refactor: replace dump with print_now! (#35) 2023-03-08 11:58:50 +08:00
sigoden
b7cb6f89f1
fix: repl set save true not work if not rerun(#34) 2023-03-08 11:27:51 +08:00
sigoden
b05fce7bca
refactor: split long paragraphs for smoother stream output (#33) 2023-03-08 10:40:19 +08:00
sigoden
ec1c4bcf8f
refactor: theme and code color (#32) 2023-03-08 07:25:32 +08:00
sigoden
360264121c
feat: command mode supports stream out (#31)
* feat: command mode supports stream out

* update cli
2023-03-07 22:33:34 +08:00
sigoden
c7fcdb1744
refactor: adjust repl (#30)
- abandon .copy
- rename .multiple => .editor
- if command successed, do not output `Done`
- if command failed, output `Error: <error message>`
2023-03-07 19:04:54 +08:00
sigoden
d73be65b07
refactor: support highlighting more languages (#28) 2023-03-07 15:37:03 +08:00
sigoden
11dc4d104b
refactor: optimize ctrl+c/ctrl+d abort handling (#27) 2023-03-07 11:51:52 +08:00
sigoden
1640456049
refactor: use syntect for highlight, abandon mdcat (#26)
* refactor: use syntect for highlight, abandon mdcat

* split src/render.rs to sub modules. embed a default theme

* simulate typing effect.

* fix format
2023-03-07 11:38:44 +08:00
sigoden
c12ae02751 chore: improve code by renameing some function 2023-03-06 16:35:51 +08:00
sigoden
056f38428c
fix: $AI_CONFIG_DIR points to the parent directory (#25) 2023-03-06 10:47:50 +08:00
sigoden
ffa444399f chore: release v0.4.0 2023-03-06 10:34:07 +08:00
sigoden
f29ca57446 chore: optimize cli help 2023-03-06 10:08:59 +08:00
sigoden
cfb46ca0de
feat: add --no-highlight option (#24) 2023-03-06 09:27:49 +08:00
sigoden
7def9aef01
fix: combine pipe and cli args, disable highlight when pipe (#23) 2023-03-06 08:43:24 +08:00
sigoden
c5a2f4603c chore: optimize code 2023-03-06 07:08:51 +08:00
sigoden
2152667fc6
refactor: split src/repl.rs to submodules (#22) 2023-03-06 06:45:00 +08:00
sigoden
d40913d739
feat: add .prompt command (#21)
* feat: add `.prompt` command

* set temp role name
2023-03-06 05:30:20 +08:00
sigoden
4b1d6c16b3
feat: add .set command (#20)
* feat: add `.set` command

* Add config.role
2023-03-05 22:51:29 +08:00
sigoden
957ea431c2
refactor: rename config.no_highlight to highlight (#19) 2023-03-05 19:48:22 +08:00
sigoden
aadffb17a3
feat: repl command replaces .editor with .multiline (#18)
You can use `.multiline` command to put multiline content

```
〉.multiline {
::: abc
::: cdf
::: }
```
It's much easier than `.editor`.
2023-03-05 19:16:41 +08:00
sigoden
625f0343cb chore: refactor error encapsulation 2023-03-05 16:45:42 +08:00
sigoden
2ac0155fa3
feat: accept pipe (#17)
`cat data | aichat` works
2023-03-05 11:11:15 +08:00
sigoden
d876818df1
refactor: optimize clear screen (#16) 2023-03-05 10:42:35 +08:00
sigoden
181fbe8163
refactor: adjusted command name (#14)
* refactor: adjusted command name

.clear => .clear screen
.clear-history => .clear history
.clear-role => .clear role

* re-order commands in help text
2023-03-05 08:34:43 +08:00
sigoden
598c31c3d9
refactor: optimize role prompt (#13) 2023-03-05 07:52:36 +08:00
sigoden
822f0eed94
refactor: message record format (#12)
```
i am excited

--------
😃💥🎉
--------
```
2023-03-05 06:17:43 +08:00
sigoden
7a60a36367
feat: add .info command (#11) 2023-03-05 05:50:30 +08:00
sigoden
a055d4bee6
feat: add .copy command (#10) 2023-03-05 00:19:48 +08:00
sigoden
5179b9a827
feat: add .editor command (#9)
* feat: add `.editor` command

Use `.editor` to edit/input multiline text

* support paste
2023-03-05 00:01:45 +08:00
sigoden
069583098f
refactor: no need tui, just render stream directly (#8) 2023-03-04 22:18:42 +08:00
sigoden
e594d1bd5f chore: fix typos 2023-03-04 18:28:42 +08:00
sigoden
71f1127f9a
fix: tui warp long paragraph (#6)
* chore: optimize stream render

* fix: tui textwrap long paragraph
2023-03-04 18:18:00 +08:00
sigoden
b058cca46d
refactor: use tui for better stream render (#5)
* feat: show question in the begining of stream render

* refactor: use tui for better stream render

* trivial updates

* fine-tune stream text merging
2023-03-04 15:00:11 +08:00
sigoden
dbdb2ed125
refactor: replace config.highlight with config.no_highlight (#4)
* refactor: replace config.highlight with config.no_highlight

* update readme
2023-03-04 09:22:55 +08:00
sigoden
0fa1ae215a
feat: support highlight reply markdown (#3)
* feat: support highlight reply markdown

* migrate markdown highlighter from termimad to mdcat

* optimize render

No need to clear screen when there is no newline in reply token

* handle ctrl-c when rendering stream

* update readme

* fix ctrlc don't abort acquire_stream when establish connection

* ensure render_stream's dtect_ctrlc is exit before next readline

This will make reedline don't throw err 'The cursor position could not be read within a normal duration'
2023-03-04 09:02:57 +08:00
sigoden
3ffebce8bb refactor: split into separate mods 2023-03-03 18:27:42 +08:00
sigoden
2e511c1327 chore: optimize config path 2023-03-03 12:43:34 +08:00
sigoden
17ee12a7f9 feat: support initial configuration items 2023-03-03 10:24:27 +08:00
sigoden
627a2d08ce refactor: config path and config data
use yaml other than toml for configuration.
use $AICHAT_CONFIG_DIR other than $HOME for config dir.
split roles to seperate config file
2023-03-03 10:11:23 +08:00
sigoden
9e8a5481cf feat: support save chat messages to file 2023-03-03 09:15:58 +08:00
sigoden
b516080a66 chore: update readme 2023-03-03 08:34:15 +08:00
sigoden
7057b9db19 refactor: remove config::Role.first_sentense 2023-03-03 08:26:59 +08:00
sigoden
6178959454 feat: add .view command 2023-03-03 08:04:15 +08:00
sigoden
99c48a3c59 feat: enable connect timeout 2023-03-03 02:43:21 +08:00
sigoden
1099edcb1a refactor: optimize line sperator 2023-03-03 00:51:23 +08:00
sigoden
48ebf1895d feat: remove the first two newlines 2023-03-02 23:22:06 +08:00
sigoden
57844638ce feat: add config.temperature 2023-03-02 23:11:34 +08:00
sigoden
f6e4e4889c refactor: optimize .role command 2023-03-02 22:45:54 +08:00
sigoden
97af9322e7 feat: support list roles with --list-roles 2023-03-02 22:26:32 +08:00
sigoden
f66d33e324 feat: handle ctrl-c 2023-03-02 21:52:19 +08:00
sigoden
a9128f7933 refactor: reorganize repl commands 2023-03-02 21:19:26 +08:00
sigoden
a80399df36 feat: repl supports history 2023-03-02 20:11:17 +08:00
sigoden
dfebab910d init commit 2023-03-02 19:52:11 +08:00