From 22c646ae5dfa478761e5ea60ace6d223957e3567 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 31 May 2023 08:33:49 +0900 Subject: [PATCH 1/2] [fix] group chat activation & talkness --- src/ts/process/group.ts | 8 +++++--- src/ts/process/index.ts | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ts/process/group.ts b/src/ts/process/group.ts index 86ed862d..5af16c31 100644 --- a/src/ts/process/group.ts +++ b/src/ts/process/group.ts @@ -56,6 +56,7 @@ export type GroupOrder = { export function groupOrder(chars:GroupOrder[], input:string):GroupOrder[] { let order:GroupOrder[] = []; + let ids:string[] = [] if (input) { const words = getWords(input) @@ -66,6 +67,7 @@ export function groupOrder(chars:GroupOrder[], input:string):GroupOrder[] { if (charNameChunks.includes(word)) { order.push(char); + ids.push(char.id) break; } } @@ -74,15 +76,15 @@ export function groupOrder(chars:GroupOrder[], input:string):GroupOrder[] { const shuffled = shuffle(chars) for (const char of shuffled) { - if(order.includes(char)){ + if(ids.includes(char.id)){ continue } - //TODO - const chance = 0.5 + const chance = char.talkness ?? 0.5 if (chance >= Math.random()) { order.push(char); + ids.push(char.id) } } diff --git a/src/ts/process/index.ts b/src/ts/process/index.ts index a694092e..5df79a20 100644 --- a/src/ts/process/index.ts +++ b/src/ts/process/index.ts @@ -79,6 +79,8 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n talkness: nowChatroom.characterActive[i] ? nowChatroom.characterTalks[i] : -1, index: i } + }).filter((v) => { + return v.talkness > 0 }) if(!nowChatroom.orderByOrder){ order = groupOrder(order, lastMessage?.data).filter((v) => { From 8e5df4409094028fc9d5c8b498174411ec494b92 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Wed, 31 May 2023 08:34:20 +0900 Subject: [PATCH 2/2] bump version to 1.22.1 --- src-tauri/tauri.conf.json | 2 +- src/ts/storage/database.ts | 2 +- version.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 71fe803d..410af6c3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "RisuAI", - "version": "1.22.0" + "version": "1.22.1" }, "tauri": { "allowlist": { diff --git a/src/ts/storage/database.ts b/src/ts/storage/database.ts index ddd0a4a1..0156f5d0 100644 --- a/src/ts/storage/database.ts +++ b/src/ts/storage/database.ts @@ -8,7 +8,7 @@ import { defaultAutoSuggestPrompt, defaultJailbreak, defaultMainPrompt } from '. export const DataBase = writable({} as any as Database) export const loadedStore = writable(false) -export let appVer = '1.22.0' +export let appVer = '1.22.1' export function setDatabase(data:Database){ if(checkNullish(data.characters)){ diff --git a/version.json b/version.json index aa370722..8d9a1e92 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{"version":"1.22.0"} \ No newline at end of file +{"version":"1.22.1"} \ No newline at end of file