diff --git a/src/lang/en.ts b/src/lang/en.ts
index 62e17528..73be9cb1 100644
--- a/src/lang/en.ts
+++ b/src/lang/en.ts
@@ -135,6 +135,7 @@ export const languageEnglish = {
luaHelp: "You can use Lua scripts as a trigger script. you can define onInput, onOutput, onStart functions. onInput is called when user sends a message, onOutput is called when character sends a message, onStart is called when the chat starts. for more information, see the documentation.",
claudeCachingExperimental: "Caching in Claude is experimental feature that can reduce the cost of the model, but it can also increase the cost if you use it without reroll. since this is a experimental feature, it can be unstable and behavior can be changed in the future.",
urllora: "You can use direct download link of the model file. you can make direct url from google drive like website like https://sites.google.com/site/gdocs2direct/ , or use civitai URL, copy the the AIR (looks like `urn:air:flux1:lora:civitai:180891@776656` or just `civitai:180891@776656`) and paste it.",
+ namespace: "Namespace is a unique identifier for the module. it is used to prevent conflicts between modules, and for interaction of presets, other modules and etc. if you are not sure what to put, leave it blank.",
},
setup: {
chooseProvider: "Choose AI Provider",
@@ -688,5 +689,7 @@ export const languageEnglish = {
hideApiKeys: "Hide API Keys",
unformatQuotes: "Disable Quote Formatting",
enableDevTools: "Enable Dev Tools",
- selectFile: "Select File"
+ selectFile: "Select File",
+ namespace: "Namespace",
+ moduleIntergration: "Module Integration",
}
\ No newline at end of file
diff --git a/src/lib/Setting/Pages/BotSettings.svelte b/src/lib/Setting/Pages/BotSettings.svelte
index e3b1a43c..fea7aa2f 100644
--- a/src/lib/Setting/Pages/BotSettings.svelte
+++ b/src/lib/Setting/Pages/BotSettings.svelte
@@ -563,6 +563,9 @@
}}/>
{/if}
+
+
+
{#if submenu !== -1}
{/if}
diff --git a/src/lib/Setting/Pages/Module/ModuleMenu.svelte b/src/lib/Setting/Pages/Module/ModuleMenu.svelte
index 48847e5b..19642ff5 100644
--- a/src/lib/Setting/Pages/Module/ModuleMenu.svelte
+++ b/src/lib/Setting/Pages/Module/ModuleMenu.svelte
@@ -121,8 +121,12 @@
{#if submenu === 0}
-
-
+ {language.name}
+
+ {language.description}
+
+ {language.namespace}
+
diff --git a/src/ts/process/modules.ts b/src/ts/process/modules.ts
index 8c3b5e95..8eb274d1 100644
--- a/src/ts/process/modules.ts
+++ b/src/ts/process/modules.ts
@@ -24,6 +24,7 @@ export interface RisuModule{
hideIcon?: boolean
backgroundEmbedding?:string
assets?:[string,string,string][]
+ namespace?:string
}
export async function exportModule(module:RisuModule){
@@ -242,19 +243,39 @@ function getModuleById(id:string){
return null
}
+function getModuleByIds(ids:string[]){
+ let modules:RisuModule[] = []
+ const db = get(DataBase)
+ for(let i=0;i s.trim())
+ ids = ids.concat(intList)
+ }
const idsJoined = ids.join('-')
if(lastModules === idsJoined){
return lastModuleData
}
- let modules:RisuModule[] = []
- for(const id of ids){
- const module = getModuleById(id)
- modules.push(module)
- }
+ let modules:RisuModule[] = getModuleByIds(ids)
lastModules = idsJoined
lastModuleData = modules
return modules
@@ -263,12 +284,7 @@ export function getModules(ids:string[]){
export function getModuleLorebooks() {
- const currentChat = get(CurrentChat)
- const db = get(DataBase)
- if (!currentChat) return []
- let moduleIds = currentChat.modules ?? []
- moduleIds = moduleIds.concat(db.enabledModules)
- const modules = getModules(moduleIds)
+ const modules = getModules()
let lorebooks: loreBook[] = []
for (const module of modules) {
if(!module){
@@ -282,12 +298,7 @@ export function getModuleLorebooks() {
}
export function getModuleAssets() {
- const currentChat = get(CurrentChat)
- const db = get(DataBase)
- if (!currentChat) return []
- let moduleIds = currentChat.modules ?? []
- moduleIds = moduleIds.concat(db.enabledModules)
- const modules = getModules(moduleIds)
+ const modules = getModules()
let assets: [string,string,string][] = []
for (const module of modules) {
if(!module){
@@ -302,12 +313,7 @@ export function getModuleAssets() {
export function getModuleTriggers() {
- const currentChat = get(CurrentChat)
- const db = get(DataBase)
- if (!currentChat) return []
- let moduleIds = currentChat.modules ?? []
- moduleIds = moduleIds.concat(db.enabledModules)
- const modules = getModules(moduleIds)
+ const modules = getModules()
let triggers: triggerscript[] = []
for (const module of modules) {
if(!module){
@@ -324,12 +330,7 @@ export function getModuleTriggers() {
}
export function getModuleRegexScripts() {
- const currentChat = get(CurrentChat)
- const db = get(DataBase)
- if (!currentChat) return []
- let moduleIds = currentChat.modules ?? []
- moduleIds = moduleIds.concat(db.enabledModules)
- const modules = getModules(moduleIds)
+ const modules = getModules()
let customscripts: customscript[] = []
for (const module of modules) {
if(!module){
diff --git a/src/ts/storage/database.ts b/src/ts/storage/database.ts
index 18742a46..83d4ddbe 100644
--- a/src/ts/storage/database.ts
+++ b/src/ts/storage/database.ts
@@ -725,6 +725,7 @@ export interface Database{
falLora: string
falLoraName: string
falLoraScale: number
+ moduleIntergration: string
}
export interface customscript{
@@ -975,6 +976,7 @@ export interface botPreset{
useInstructPrompt?:boolean
customPromptTemplateToggle?:string
templateDefaultVariables?:string
+ moduleIntergration?:string
}
@@ -1254,6 +1256,7 @@ export function saveCurrentPreset(){
useInstructPrompt: db.useInstructPrompt,
customPromptTemplateToggle: db.customPromptTemplateToggle ?? "",
templateDefaultVariables: db.templateDefaultVariables ?? "",
+ moduleIntergration: db.moduleIntergration ?? "",
}
db.botPresets = pres
setDatabase(db)
@@ -1338,6 +1341,7 @@ export function setPreset(db:Database, newPres: botPreset){
db.useInstructPrompt = newPres.useInstructPrompt ?? false
db.customPromptTemplateToggle = newPres.customPromptTemplateToggle ?? ''
db.templateDefaultVariables = newPres.templateDefaultVariables ?? ''
+ db.moduleIntergration = newPres.moduleIntergration ?? ''
return db
}