diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-08 19:43:11 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-08 19:43:11 +0800 |
| commit | 56483e04f0b8c74e9f7f809e1a0035ca876e35f6 (patch) | |
| tree | 0bb0e5cc584abc2a3e9c31c78a1ccaea24fbb8cd /src/utils.rs | |
| parent | 2539e24fe9eadf69cb20b01d2303a99fa2e8a363 (diff) | |
| download | aichat-56483e04f0b8c74e9f7f809e1a0035ca876e35f6.tar.gz | |
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
```
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs index 76f2b8f..2c61f1c 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,5 @@ use chrono::prelude::*; +use crossterm::style::{Color, Stylize}; use std::io::{stdout, Write}; #[macro_export] @@ -17,3 +18,7 @@ pub fn now() -> String { let now = Local::now(); now.to_rfc3339_opts(SecondsFormat::Secs, false) } + +pub fn emphasis(text: &str) -> String { + text.stylize().with(Color::White).to_string() +} |
