feat: chatgpt prompts

This commit is contained in:
lencx
2022-12-17 14:29:46 +08:00
parent 47c9072f40
commit 1e7c0fe02a
10 changed files with 178 additions and 1 deletions

View File

@@ -63,4 +63,11 @@ pub fn form_msg(app: AppHandle, label: &str, title: &str, msg: &str) {
#[command]
pub fn open_file(path: PathBuf) {
utils::open_file(path);
}
#[command]
pub fn get_chat_model() -> serde_json::Value {
let path = utils::chat_root().join("chat.model.json");
let content = fs::read_to_string(path).unwrap_or_else(|_| r#"{"data":[]}"#.to_string());
serde_json::from_str(&content).unwrap()
}