Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
UI Page MemoryPrompt AI [Chat Commands] (#42)
Browse files Browse the repository at this point in the history
[+] feat(command): add support for copymemoryai command
[+] fix(chat): implement copymemoryai command functionality
[+] feat(cn): add translation for copymemoryai command
[+] feat(en): add translation for copymemoryai command
[+] feat(id): add translation for copymemoryai command
  • Loading branch information
H0llyW00dzZ authored Oct 7, 2023
1 parent ffb1d11 commit 39dd418
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ interface ChatCommands {
del?: Command;
save?: Command;
load?: Command;
copymemoryai?: Command;
}

export const ChatCommandPrefix = ":";
Expand Down
9 changes: 9 additions & 0 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,15 @@ function _Chat() {
save: () =>
downloadAs((session), `${session.topic}.json`),
load: loadchat,
copymemoryai: () => {
const memoryPrompt = chatStore.currentSession().memoryPrompt;
if (memoryPrompt.trim() !== "") {
copyToClipboard(memoryPrompt);
showToast(Locale.Copy.Success);
} else {
showToast(Locale.Copy.Failed);
}
},
});

// only search prompts when user input is short
Expand Down
1 change: 1 addition & 0 deletions app/locales/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const cn = {
del: "删除聊天",
save: "保存当前会话聊天",
load: "加载会话聊天",
copymemoryai: "复制一个记忆会话的提示AI",
},
InputActions: {
Stop: "停止响应",
Expand Down
1 change: 1 addition & 0 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const en: LocaleType = {
del: "Delete Chat",
save: "Save a current session chat",
load: "Load a session chat",
copymemoryai: "Copy a session of memory prompt ai",
},
InputActions: {
Stop: "Stop",
Expand Down
1 change: 1 addition & 0 deletions app/locales/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const id: PartialLocaleType = {
del: "Hapus Chat",
save: "Simpan Percakapan Sesi Saat Ini",
load: "Muat Percakapan Sesi",
copymemoryai: "Salin sesi memori prompt AI",
},
InputActions: {
Stop: "Berhenti",
Expand Down

0 comments on commit 39dd418

Please sign in to comment.