summaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-08 19:43:11 +0800
committerGitHub <noreply@github.com>2023-03-08 19:43:11 +0800
commit56483e04f0b8c74e9f7f809e1a0035ca876e35f6 (patch)
tree0bb0e5cc584abc2a3e9c31c78a1ccaea24fbb8cd /src/client.rs
parent2539e24fe9eadf69cb20b01d2303a99fa2e8a363 (diff)
downloadaichat-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/client.rs')
-rw-r--r--src/client.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index 862fa0e..6d01109 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -148,7 +148,7 @@ impl ChatGptClient {
"messages": messages,
});
- if let Some(v) = self.config.borrow().temperature {
+ if let Some(v) = self.config.borrow().get_temperature() {
body.as_object_mut()
.and_then(|m| m.insert("temperature".into(), json!(v)));
}