Commit Graph

175 Commits

Author SHA1 Message Date
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>
2023-05-04 21:22:12 +08:00
sigoden
2489e34993
fix: config file with strict perms (#118) 2023-05-04 16:29:34 +08:00
sigoden
f257931b0b
fix: mask api_key/organization_id in info text (#93) 2023-03-22 21:02:09 +08:00
sigoden
601a5134d0
feat: add --dry-run (#83) 2023-03-20 23:20:48 +08:00
sigoden
19ce62ab76
feat: check token usage in dry_run mode (#82) 2023-03-20 22:51:51 +08:00
sigoden
acddece520
feat: add config.organization_id (#77) 2023-03-17 15:09:06 +08:00
sigoden
66a73c7b84
feat: add config.connect_timeout (#76) 2023-03-16 17:11:25 +08:00
sigoden
1ef97b2f32
feat: support multiple models (#71) 2023-03-16 17:02:09 +08:00
sigoden
ad04f60365 chore: optimzie role args 2023-03-13 10:13:50 +08:00
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
2023-03-13 10:09:01 +08:00
sigoden
8fa2e2683b
feat: support HTTPS_PROXY and ALL_PROXY (#68) 2023-03-12 08:31:06 +08:00
sigoden
4aab872ee1
feat: add support for NO_COLOR (#67) 2023-03-11 21:45:34 +08:00
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
2023-03-11 18:53:36 +08:00
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
2023-03-11 11:26:24 +08:00
sigoden
d48cd64162
feat: provide --prompt for adding a prompt from cli (#62) 2023-03-11 07:37:47 +08:00
sigoden
978d4c54c0 chore: opitmize code, move MAX_TOKENS related to config/message.rs 2023-03-10 07:25:33 +08:00
sigoden
899c4af9ea fix: forbid .clear role in middle of conversation 2023-03-10 07:13:22 +08:00
sigoden
4161eaa6c3
fix: cli specify role is not applied when conversation_first set true (#57)
close #56
2023-03-10 07:02:44 +08:00
sigoden
0044399509
feat: add config.conversation_first (#55)
If set true, start a conversation immediately upon repl.
2023-03-09 23:30:12 +08:00
sigoden
ad282ae74c refactor: no need to confirm conversation when token used out 2023-03-09 22:53:25 +08:00
sigoden
553d0fe55b
refactor: optimize counting tokens (#53) 2023-03-09 21:18:28 +08:00
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.
```
2023-03-09 19:10:02 +08:00
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
2023-03-09 16:52:04 +08:00
sigoden
05d20f207f
feat: add remain tokens indicator and max tokens guard (#50) 2023-03-09 15:30:39 +08:00
sigoden
a62e461e38
feat: support conversation (#48) 2023-03-09 10:39:28 +08:00