From de3c408cc1f0ff58ae0aec56319fc13bbe9bbeec Mon Sep 17 00:00:00 2001 From: somebody Date: Thu, 20 Oct 2022 18:04:11 -0500 Subject: [PATCH 1/2] Support title in aidg import --- aiserver.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aiserver.py b/aiserver.py index 31f03630..ef6f7425 100644 --- a/aiserver.py +++ b/aiserver.py @@ -297,6 +297,7 @@ class ImportBuffer: authors_note: Optional[str] = None notes: Optional[str] = None world_infos: Optional[dict] = None + title: Optional[str] = None @dataclass class PromptPlaceholder: @@ -416,6 +417,7 @@ class ImportBuffer: self.memory = j["memory"] self.authors_note = j["authorsNote"] self.notes = j["description"] + self.title = j["title"] or "Imported Story" self.world_infos = [] @@ -449,6 +451,7 @@ class ImportBuffer: koboldai_vars.memory = self.memory or "" koboldai_vars.authornote = self.authors_note or "" koboldai_vars.notes = self.notes + koboldai_vars.story_name = self.title for wi in self.world_infos: koboldai_vars.worldinfo_v2.add_item( From 0f8190bfc9437ec419b47178e63e4213220e55e8 Mon Sep 17 00:00:00 2001 From: somebody Date: Thu, 20 Oct 2022 18:04:36 -0500 Subject: [PATCH 2/2] Add aidg import to finder --- static/koboldai.js | 5 +++++ templates/popups.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/static/koboldai.js b/static/koboldai.js index 4fdf80c3..b92758af 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -76,6 +76,7 @@ var finder_actions = [ {name: "Load Story", icon: "folder_open", type: "action", func: function() { socket.emit('load_story_list', ''); }}, {name: "Save Story", icon: "save", type: "action", func: function() { socket.emit("save_story", null, (response) => {save_as_story(response);}); }}, {name: "Download Story", icon: "file_download", type: "action", func: function() { document.getElementById('download_iframe').src = 'json'; }}, + {name: "Import Story", icon: "file_download", desc: "Import a prompt from aetherroom.club, formerly prompts.aidg.club", type: "action", func: openClubImport }, // Locations {name: "Setting Presets", icon: "open_in_new", type: "location", func: function() { highlightEl(".var_sync_model_selected_preset") }}, @@ -4616,6 +4617,10 @@ function updateTitle() { document.title = `${titleInput.innerText} - KoboldAI Client`; } +function openClubImport() { + document.getElementById("import_aidg_club_popup").classList.remove("hidden"); +} + //// INIT //// document.onkeydown = detect_key_down; diff --git a/templates/popups.html b/templates/popups.html index 0dbe9b98..cc1e7b56 100644 --- a/templates/popups.html +++ b/templates/popups.html @@ -22,7 +22,7 @@ Load from Local -