feat: use the keyboard to select the slash command

This commit is contained in:
lencx
2022-12-27 14:41:50 +08:00
parent f8c1ca5c56
commit 477120ef3b
6 changed files with 124 additions and 34 deletions

View File

@@ -1,4 +1,7 @@
use crate::{conf::ChatConfJson, utils::{self, exists}};
use crate::{
conf::ChatConfJson,
utils::{self, exists},
};
use std::{collections::HashMap, fs, path::PathBuf};
use tauri::{api, command, AppHandle, Manager};
@@ -152,10 +155,15 @@ pub fn sync_prompts(app: AppHandle, data: String, time: u64) {
let chatgpt_prompts = chat_root().join("cache_model").join("chatgpt_prompts.json");
if !exists(&model) {
fs::write(&model, serde_json::json!({
"name": "ChatGPT Model",
"link": "https://github.com/lencx/ChatGPT"
}).to_string()).unwrap();
fs::write(
&model,
serde_json::json!({
"name": "ChatGPT Model",
"link": "https://github.com/lencx/ChatGPT"
})
.to_string(),
)
.unwrap();
}
// chatgpt_prompts.json