sigoden
9b614600c6
fix: uncorrected render in command mode ( #188 )
11 months ago
sigoden
680670e834
feat: support custom theme ( #187 )
11 months ago
sigoden
84004fd576
feat: support OPENAI_API_BASE ( #186 )
11 months ago
sigoden
36380475d5
feat: support azure-openai ( #166 )
11 months ago
sigoden
86fd9d207e
fix: no last newline in reply text on windows os ( #185 )
11 months ago
sigoden
e86ad7dc16
feat: add `.info role` and `.info session` ( #183 )
11 months ago
sigoden
4909a20f2e
feat: force nowrap if no tty/terminal ( #182 )
11 months ago
sigoden
2203163938
chore: update readme and cli help
11 months ago
sigoden
5c0383f908
fix: dry run on role or session ( #181 )
11 months ago
sigoden
2168610dbd
chore: spellcheck
11 months ago
sigoden
23e9fb5bbf
feat: deprecate .clear command ( #180 )
11 months ago
sigoden
ba3cc4f15d
feat: deprecate history file ( #179 )
11 months ago
sigoden
2f9121e515
fix: bugs between sesison/role ( #178 )
11 months ago
sigoden
f2c9f00bda
fix: detect light theme only by env var ( #177 )
11 months ago
sigoden
b3e6879438
feat: deprecate prompt, remove `--prompt` and `.prompt` ( #176 )
11 months ago
sigoden
44ea384ee5
chore: remove unnecessary clippy macros
11 months ago
sigoden
651516d49a
feat: show role info with `--role <name> --info` ( #175 )
11 months ago
sigoden
b276dfedd2
feat: support textwrap ( #171 )
...
* feat: support textwrap
* improve cmd_render_stream
* done cmd_render_stream
* add `-w` alias to `--wrap`
* done repl_render_stream
* add `config.wrap_code`
* remove cached config.wrap_width
* fix unxpected duplicate lines on kitty
* refactor markdown render
* improve render
* fix test
11 months ago
sigoden
632a6fcc0b
feat: add `--light-theme` option ( #169 )
11 months ago
sigoden
1ced15a209
feat: autodetect light theme on unix-like os ( #168 )
11 months ago
sigoden
10b1d4b4de
fix: unexpcted duplicate lines in kitty ( #167 )
11 months ago
sigoden
985f8c0946
chore: improve client-related code quality
11 months ago
sigoden
871adab22a
chore: improve code quanity
11 months ago
sigoden
7f5bad6474
chore: improve code and doc
11 months ago
sigoden
2ab2e23bb0
refactor: improve environment variables ( #163 )
...
Rename `AICHAT_API_KEY` to `OPENAI_API_KEY`
Add `LOCALAI_API_KEY`
11 months ago
sigoden
bc44026ff8
feat: enhance session/conversation ( #162 )
...
* feat: enhance session/conversation
* updates
* updates
* cut version v0.9.0-rc2
* add .session name completion
11 months ago
sigoden
1575d44172
fix: .copy don't works on some linux distro ( #161 )
11 months ago
sigoden
aa43612d91
feat: change config.vi_keybindings to config.keybindings ( #158 )
11 months ago
sigoden
dbbbbfd5d6
chore: update readme and comments
11 months ago
sigoden
d43425e22b
chore: change left-prompt for conversation ( #157 )
11 months ago
sigoden
0179bef80d
chore: replace atty with is-terminal ( #156 )
11 months ago
sigoden
47818159a7
refactor: streaming input text in dry-run mode ( #154 )
11 months ago
sigoden
2fad63be6a
fix: parse command fails if command following newline ( #153 )
11 months ago
sigoden
ca0f6343f2
feat: add .edit command for multi-line editing ( #151 )
11 months ago
sigoden
b3f8f27018
refactor: improve code quanity
11 months ago
Leo Bergnéhr
c3f9ef6c39
feat: add .read command ( #145 )
11 months ago
sigoden
66fd547c0f
refactor: improve code quanity
...
remove tokio::runtime::Runtime from client
11 months ago
sigoden
7d8564cafb
feat: support multi bots and custom url ( #150 )
11 months ago
sigoden
f4160ff85b
feat: suppport vi keybindings ( #148 )
11 months ago
sigoden
b5e1460151
feat: use backslash at end of line for multiline text ( #147 )
...
BREAKING CHANGE: use backslash at end of line for multiline text
```
〉.set dry_run true
〉abc \
def \
ijk
>>> The following message consumes 12 tokens.
abc
def
ijk
```
Deprecate old {}/() multi-line editing
11 months ago
sigoden
90bdc1b7db
chore: update deps
12 months ago
Jackson Goode
30daa40eb0
fix: grammar/wording corrections ( #135 )
1 year ago
Anthony Rubick
97fc7de675
fix: minor code cleanup and pedantic lints ( #134 )
1 year ago
sigoden
ec51b84290
feat: add new model gpt-3.5-turbo-16k ( #126 )
1 year ago
sigoden
00ce157571
feat: add `.copy` command ( #119 )
1 year ago
shane s
cf03952c7b
feat: add `config.auto_copy` ( #102 )
...
* added config option to copy all ChatGPT output to clipboard
* formatted with
* updates
---------
Co-authored-by: sigoden <sigoden@gmail.com>
1 year ago
sigoden
2489e34993
fix: config file with strict perms ( #118 )
1 year ago
sigoden
439d231e42
chore: trivial updates
1 year ago
sigoden
065a32decb
feat: support backeted paste ( #117 )
1 year ago
sigoden
a7b31d4367
chore: fix typo
1 year ago
sigoden
f257931b0b
fix: mask api_key/organization_id in info text ( #93 )
2 years ago
sigoden
601a5134d0
feat: add `--dry-run` ( #83 )
2 years ago
sigoden
19ce62ab76
feat: check token usage in dry_run mode ( #82 )
2 years ago
sigoden
28f019b72c
feat: add `--info` ( #79 )
2 years ago
sigoden
acddece520
feat: add `config.organization_id` ( #77 )
2 years ago
sigoden
66a73c7b84
feat: add `config.connect_timeout` ( #76 )
2 years ago
sigoden
1ef97b2f32
feat: support multiple models ( #71 )
2 years ago
sigoden
ad04f60365
chore: optimzie role args
2 years ago
sigoden
9c04455e36
feat: support role args ( #69 )
...
* feat: support role args
We can use role args to pass some additional arguments to the prompt.
```
- name: convert:json:yaml
prompt: convert __ARG1__ below to __ARG2__
```
`:json:yaml` is `role args`. It has two args:
- arg1 `json`, it will replace __ARG1__ in prompt
- arg2 `yaml`, it will replace __ARG2__ in prompt
```
〉.role convert:json:yaml
name: convert:json:yaml
prompt: convert json below to yaml
temperature: null
〉.role convert:yaml:json
name: convert:yaml:json
prompt: convert yaml below to json
temperature: null
```
different role args, will generate different prompts.
* small updates
2 years ago
sigoden
8fa2e2683b
feat: support HTTPS_PROXY and ALL_PROXY ( #68 )
2 years ago
sigoden
0ed0ad1fd2
chore: optimize readline multiline
2 years ago
sigoden
4aab872ee1
feat: add support for NO_COLOR ( #67 )
2 years ago
sigoden
cfb6ce6958
feat: support light theme ( #65 )
...
There are two ways to enable the light theme:
- add `light_theme: true` to config.yaml
- use `AICHAT_LIGHT_THEME=true` env var
2 years ago
sigoden
dc09cb38d4
feat: support more env vars ( #63 )
...
- AICHAT_CONFIG_DIR: sepecify the configuration directory
- AICHAT_ROLES_FILE: set the `roles.yaml` file path
- AICHAT_API_KEY: set the api key
2 years ago
sigoden
d48cd64162
feat: provide `--prompt` for adding a prompt from cli ( #62 )
2 years ago
sigoden
cc626e73df
chore: update `.help` output text
2 years ago
sigoden
1dc16e6709
feat: type `{` `[` `(` to enter multi-line editing mode ( #58 )
...
Abandon `.editor` command, it's too complicated.
2 years ago
sigoden
54e6edbf21
chore: recovery cursor in case of stream abort
2 years ago
sigoden
865fb49af9
chore: improve code quality, omit head 2 newlines in handler but in not client
2 years ago
sigoden
978d4c54c0
chore: opitmize code, move MAX_TOKENS related to config/message.rs
2 years ago
sigoden
899c4af9ea
fix: forbid .clear role in middle of conversation
2 years ago
sigoden
ff00426c2c
chore: improve code quality, split rep/prompt.rs from repl/init.rs
2 years ago
sigoden
4161eaa6c3
fix: cli specify role is not applied when conversation_first set true ( #57 )
...
close #56
2 years ago
sigoden
0044399509
feat: add config.conversation_first ( #55 )
...
If set true, start a conversation immediately upon repl.
2 years ago
sigoden
ad282ae74c
refactor: no need to confirm conversation when token used out
2 years ago
sigoden
89eaf1b653
fix: csharp and php do not render correctly
2 years ago
sigoden
553d0fe55b
refactor: optimize counting tokens ( #53 )
2 years ago
sigoden
9767c07eee
feat: support two types of role prompts ( #52 )
...
1. embeded prompt
use __INPUT__ placeholder
will generate one user message when send to gpt
```
- name: shell
prompt: >
I want you to act as a linux shell expert.
Q: How to unzip a file
A: unzip file.zip
Q: __INPUT__
A:
```
2. system prompt
no __INPUT__ placeholder
will generate on system message and one user message when send to gpt
```
- name: shell
prompt: |
I want you to act as a linux shell expert.
I want you to answer only with bash code.
Do not write explanations.
```
2 years ago
sigoden
c45d71cdea
refactor: trivial updates
...
- change prompt's temp role name
- questionnaire of 'save chat messages' default set true
- `.info` do not show role name
2 years ago
sigoden
05d20f207f
feat: add remain tokens indicator and max tokens guard ( #50 )
2 years ago
sigoden
c7eb261abc
fix: abort by ctrlc unexpectedly prints error message ( #49 )
2 years ago
sigoden
a62e461e38
feat: support conversation ( #48 )
2 years ago
sigoden
a7f2da156c
feat: add role info to readline indicator ( #47 )
...
```
coder〉
```
2 years ago
sigoden
e78b5f7c58
refactor: imports order and group
2 years ago
sigoden
1ec451da89
refactor: replace Arc<Refcell<Config>> with Arc<Mutex<Config>> ( #46 )
2 years ago
sigoden
00ba8b5108
refactor: extra spaces are allowed around repl command
2 years ago
sigoden
9d32837669
chore: optimize newline again ( #43 )
...
* chore: optimize newline again
command mode: should no extra newline
chat mode: should have one newline
* fix windows newline
* fix macos newline
2 years ago
sigoden
56483e04f0
feat: add role-specific config ( #42 )
...
Now we can set role temperature. For example:
```
- name: shell
prompt: >
I want you to act as a linux shell expert.
I want you to answer only with bash code.
Do not write explanations.
temperature: 0.4
```
2 years ago
sigoden
2539e24fe9
chore: improve code by getting prompt from config ( #39 )
2 years ago
sigoden
ee81275431
fix: windows no stream output ( #37 )
2 years ago
sigoden
2a7a6f5f27
chore: no longer ignore any error
2 years ago
sigoden
4e729db237
chore: optimize output newline
2 years ago
sigoden
f694a59dcc
refactor: replace dump with print_now! ( #35 )
2 years ago
sigoden
b7cb6f89f1
fix: repl set save true not work if not rerun( #34 )
2 years ago
sigoden
b05fce7bca
refactor: split long paragraphs for smoother stream output ( #33 )
2 years ago
sigoden
ec1c4bcf8f
refactor: theme and code color ( #32 )
2 years ago
sigoden
360264121c
feat: command mode supports stream out ( #31 )
...
* feat: command mode supports stream out
* update cli
2 years ago
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>`
2 years ago
sigoden
d73be65b07
refactor: support highlighting more languages ( #28 )
2 years ago
sigoden
11dc4d104b
refactor: optimize ctrl+c/ctrl+d abort handling ( #27 )
2 years ago
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
2 years ago
sigoden
c12ae02751
chore: improve code by renameing some function
2 years ago
sigoden
056f38428c
fix: $AI_CONFIG_DIR points to the parent directory ( #25 )
2 years ago
sigoden
ffa444399f
chore: release v0.4.0
2 years ago
sigoden
f29ca57446
chore: optimize cli help
2 years ago
sigoden
cfb46ca0de
feat: add `--no-highlight` option ( #24 )
2 years ago
sigoden
7def9aef01
fix: combine pipe and cli args, disable highlight when pipe ( #23 )
2 years ago
sigoden
c5a2f4603c
chore: optimize code
2 years ago
sigoden
2152667fc6
refactor: split src/repl.rs to submodules ( #22 )
2 years ago
sigoden
d40913d739
feat: add `.prompt` command ( #21 )
...
* feat: add `.prompt` command
* set temp role name
2 years ago
sigoden
4b1d6c16b3
feat: add `.set` command ( #20 )
...
* feat: add `.set` command
* Add config.role
2 years ago
sigoden
957ea431c2
refactor: rename config.no_highlight to highlight ( #19 )
2 years ago
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`.
2 years ago
sigoden
625f0343cb
chore: refactor error encapsulation
2 years ago
sigoden
2ac0155fa3
feat: accept pipe ( #17 )
...
`cat data | aichat` works
2 years ago
sigoden
d876818df1
refactor: optimize clear screen ( #16 )
2 years ago
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
2 years ago
sigoden
598c31c3d9
refactor: optimize role prompt ( #13 )
2 years ago
sigoden
822f0eed94
refactor: message record format ( #12 )
...
```
i am excited
--------
😃 💥 🎉
--------
```
2 years ago
sigoden
7a60a36367
feat: add `.info` command ( #11 )
2 years ago
sigoden
a055d4bee6
feat: add `.copy` command ( #10 )
2 years ago
sigoden
5179b9a827
feat: add `.editor` command ( #9 )
...
* feat: add `.editor` command
Use `.editor` to edit/input multiline text
* support paste
2 years ago
sigoden
069583098f
refactor: no need tui, just render stream directly ( #8 )
2 years ago
sigoden
e594d1bd5f
chore: fix typos
2 years ago
sigoden
71f1127f9a
fix: tui warp long paragraph ( #6 )
...
* chore: optimize stream render
* fix: tui textwrap long paragraph
2 years ago
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
2 years ago
sigoden
dbdb2ed125
refactor: replace config.highlight with config.no_highlight ( #4 )
...
* refactor: replace config.highlight with config.no_highlight
* update readme
2 years ago
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'
2 years ago
sigoden
3ffebce8bb
refactor: split into separate mods
2 years ago
sigoden
2e511c1327
chore: optimize config path
2 years ago
sigoden
17ee12a7f9
feat: support initial configuration items
2 years ago
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
2 years ago
sigoden
9e8a5481cf
feat: support save chat messages to file
2 years ago
sigoden
b516080a66
chore: update readme
2 years ago
sigoden
7057b9db19
refactor: remove config::Role.first_sentense
2 years ago
sigoden
6178959454
feat: add .view command
2 years ago
sigoden
99c48a3c59
feat: enable connect timeout
2 years ago
sigoden
1099edcb1a
refactor: optimize line sperator
2 years ago
sigoden
48ebf1895d
feat: remove the first two newlines
2 years ago
sigoden
57844638ce
feat: add config.temperature
2 years ago
sigoden
f6e4e4889c
refactor: optimize .role command
2 years ago
sigoden
97af9322e7
feat: support list roles with --list-roles
2 years ago
sigoden
f66d33e324
feat: handle ctrl-c
2 years ago
sigoden
a9128f7933
refactor: reorganize repl commands
2 years ago
sigoden
a80399df36
feat: repl supports history
2 years ago
sigoden
dfebab910d
init commit
2 years ago