summaryrefslogtreecommitdiffstats
path: root/src/config.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-03 09:15:58 +0800
committersigoden <sigoden@gmail.com>2023-03-03 09:15:58 +0800
commit9e8a5481cf9aa4dfd75d5c55c003b3813ccbca1e (patch)
tree33dde22e55191cd5c1d91fabea1cea307f65efab /src/config.rs
parentb516080a661d9e6cba5cd47fa79dc62ac086f2e5 (diff)
downloadaichat-9e8a5481cf9aa4dfd75d5c55c003b3813ccbca1e.tar.gz
feat: support save chat messages to file
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index c42b11b..c99a6ef 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,4 +1,7 @@
-use std::{fs::read_to_string, path::Path};
+use std::{
+ fs::read_to_string,
+ path::{Path, PathBuf},
+};
use anyhow::{anyhow, Result};
use serde::Deserialize;
@@ -9,6 +12,8 @@ pub struct Config {
pub api_key: String,
/// What sampling temperature to use, between 0 and 2
pub temperature: Option<f64>,
+ /// Specify a file path to save chat messages to
+ pub save_path: Option<PathBuf>,
/// Set proxy
pub proxy: Option<String>,
/// Used only for debugging