diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-13 10:09:01 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-13 10:09:01 +0800 |
| commit | 9c04455e363d076cd7582fe9d476aa0fd6d86ea8 (patch) | |
| tree | d59b91e982604abf225e3c5be8aa2db1c27201c8 /src/repl/init.rs | |
| parent | 8fa2e2683bdb89aef5baf22957af1d86ed38aca7 (diff) | |
| download | aichat-9c04455e363d076cd7582fe9d476aa0fd6d86ea8.tar.gz | |
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
Diffstat (limited to 'src/repl/init.rs')
| -rw-r--r-- | src/repl/init.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/repl/init.rs b/src/repl/init.rs index ae337ee..c8bb4c3 100644 --- a/src/repl/init.rs +++ b/src/repl/init.rs @@ -47,7 +47,8 @@ impl Repl { fn create_completer(config: SharedConfig, commands: &[String]) -> DefaultCompleter { let mut completion = commands.to_vec(); completion.extend(config.read().repl_completions()); - let mut completer = DefaultCompleter::with_inclusions(&['.', '-', '_']).set_min_word_len(2); + let mut completer = + DefaultCompleter::with_inclusions(&['.', '-', '_', ':']).set_min_word_len(2); completer.insert(completion.clone()); completer } |
