feat: chatgpt prompts

This commit is contained in:
lencx
2022-12-16 21:23:46 +08:00
parent 3318bfb23f
commit 47c9072f40
10 changed files with 79 additions and 19 deletions

6
src/utils.ts vendored
View File

@@ -8,10 +8,14 @@ export const DISABLE_AUTO_COMPLETE = {
spellCheck: false
};
const chatRoot = async () => {
export const chatRoot = async () => {
return join(await homeDir(), '.chatgpt')
}
export const chatModelPath = async () => {
return join(await chatRoot(), CHAT_MODEL_JSON);
}
export const readJSON = async (path: string, defaultVal = {}) => {
const root = await chatRoot();
const file = await join(root, path);