Merge branch 'main' of https://github.com/kwaroran/RisuAI
This commit is contained in:
@@ -11,8 +11,9 @@ import { prebuiltNAIpresets, prebuiltPresets } from '../process/templates/templa
|
||||
import { defaultColorScheme, type ColorScheme } from '../gui/colorscheme';
|
||||
import type { PromptItem, PromptSettings } from '../process/prompt';
|
||||
import type { OobaChatCompletionRequestParams } from '../model/ooba';
|
||||
import { type HypaV3Settings, type HypaV3Preset, createHypaV3Preset } from '../process/memory/hypav3'
|
||||
|
||||
export let appVer = "159.0.0"
|
||||
export let appVer = "160.0.2"
|
||||
export let webAppSubVer = ''
|
||||
|
||||
|
||||
@@ -515,17 +516,21 @@ export function setDatabase(data:Database){
|
||||
data.checkCorruption ??= true
|
||||
data.OaiCompAPIKeys ??= {}
|
||||
data.reasoningEffort ??= 0
|
||||
data.hypaV3Settings = {
|
||||
memoryTokensRatio: data.hypaV3Settings?.memoryTokensRatio ?? 0.2,
|
||||
extraSummarizationRatio: data.hypaV3Settings?.extraSummarizationRatio ?? 0,
|
||||
maxChatsPerSummary: data.hypaV3Settings?.maxChatsPerSummary ?? 4,
|
||||
recentMemoryRatio: data.hypaV3Settings?.recentMemoryRatio ?? 0.4,
|
||||
similarMemoryRatio: data.hypaV3Settings?.similarMemoryRatio ?? 0.4,
|
||||
enableSimilarityCorrection: data.hypaV3Settings?.enableSimilarityCorrection ?? false,
|
||||
preserveOrphanedMemory: data.hypaV3Settings?.preserveOrphanedMemory ?? false,
|
||||
processRegexScript: data.hypaV3Settings?.processRegexScript ?? false,
|
||||
doNotSummarizeUserMessage: data.hypaV3Settings?.doNotSummarizeUserMessage ?? false
|
||||
data.hypaV3Presets ??= [
|
||||
createHypaV3Preset("Default", {
|
||||
summarizationPrompt: data.supaMemoryPrompt ? data.supaMemoryPrompt : "",
|
||||
...data.hypaV3Settings
|
||||
})
|
||||
]
|
||||
if (data.hypaV3Presets.length > 0) {
|
||||
data.hypaV3Presets = data.hypaV3Presets.map((preset, i) =>
|
||||
createHypaV3Preset(
|
||||
preset.name || `Preset ${i + 1}`,
|
||||
preset.settings || {}
|
||||
)
|
||||
)
|
||||
}
|
||||
data.hypaV3PresetId ??= 0
|
||||
data.returnCSSError ??= true
|
||||
data.useExperimentalGoogleTranslator ??= false
|
||||
if(data.antiClaudeOverload){ //migration
|
||||
@@ -535,7 +540,7 @@ export function setDatabase(data:Database){
|
||||
data.hypaCustomSettings = {
|
||||
url: data.hypaCustomSettings?.url ?? "",
|
||||
key: data.hypaCustomSettings?.key ?? "",
|
||||
model: data.hypaCustomSettings?.model ?? "",
|
||||
model: data.hypaCustomSettings?.model ?? ""
|
||||
}
|
||||
data.doNotChangeSeperateModels ??= false
|
||||
data.modelTools ??= []
|
||||
@@ -960,17 +965,9 @@ export interface Database{
|
||||
showPromptComparison:boolean
|
||||
checkCorruption:boolean
|
||||
hypaV3:boolean
|
||||
hypaV3Settings: {
|
||||
memoryTokensRatio: number
|
||||
extraSummarizationRatio: number
|
||||
maxChatsPerSummary: number
|
||||
recentMemoryRatio: number
|
||||
similarMemoryRatio: number
|
||||
enableSimilarityCorrection: boolean
|
||||
preserveOrphanedMemory: boolean
|
||||
processRegexScript: boolean
|
||||
doNotSummarizeUserMessage: boolean
|
||||
}
|
||||
hypaV3Settings: HypaV3Settings // legacy
|
||||
hypaV3Presets: HypaV3Preset[]
|
||||
hypaV3PresetId: number
|
||||
OaiCompAPIKeys: {[key:string]:string}
|
||||
inlayErrorResponse:boolean
|
||||
reasoningEffort:number
|
||||
@@ -1027,6 +1024,8 @@ export interface Database{
|
||||
useTokenizerCaching:boolean
|
||||
showMenuHypaMemoryModal:boolean
|
||||
mcpURLs:string[]
|
||||
promptInfoInsideChat:boolean
|
||||
promptTextInfoInsideChat:boolean
|
||||
}
|
||||
|
||||
interface SeparateParameters{
|
||||
@@ -1166,7 +1165,7 @@ export interface character{
|
||||
},
|
||||
chunk_length:number,
|
||||
normalize:boolean,
|
||||
|
||||
|
||||
}
|
||||
supaMemory?:boolean
|
||||
additionalAssets?:[string, string, string][]
|
||||
@@ -1430,7 +1429,11 @@ export interface NAIImgConfig{
|
||||
legacy_uc: boolean,
|
||||
v4_prompt:NAIImgConfigV4Prompt,
|
||||
v4_negative_prompt:NAIImgConfigV4NegativePrompt,
|
||||
|
||||
//add vibe
|
||||
reference_image_multiple?:string[],
|
||||
reference_strength_multiple?:number[],
|
||||
vibe_data?:NAIVibeData,
|
||||
vibe_model_selection?:string
|
||||
}
|
||||
|
||||
//add 4
|
||||
@@ -1459,6 +1462,35 @@ interface NAIImgConfigV4CharCaption{
|
||||
}[]
|
||||
}
|
||||
|
||||
// NAI Vibe Data interfaces
|
||||
interface NAIVibeData {
|
||||
identifier: string;
|
||||
version: number;
|
||||
type: string;
|
||||
image: string;
|
||||
id: string;
|
||||
encodings: {
|
||||
[key: string]: {
|
||||
[key: string]: NAIVibeEncoding;
|
||||
}
|
||||
};
|
||||
name: string;
|
||||
thumbnail: string;
|
||||
createdAt: number;
|
||||
importInfo: {
|
||||
model: string;
|
||||
information_extracted: number;
|
||||
strength: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface NAIVibeEncoding {
|
||||
encoding: string;
|
||||
params: {
|
||||
information_extracted: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface ComfyConfig{
|
||||
workflow:string,
|
||||
posNodeID: string,
|
||||
@@ -1505,6 +1537,7 @@ export interface Message{
|
||||
chatId?:string
|
||||
time?: number
|
||||
generationInfo?: MessageGenerationInfo
|
||||
promptInfo?: MessagePresetInfo
|
||||
name?:string
|
||||
otherUser?:boolean
|
||||
}
|
||||
@@ -1517,6 +1550,12 @@ export interface MessageGenerationInfo{
|
||||
maxContext?: number
|
||||
}
|
||||
|
||||
export interface MessagePresetInfo{
|
||||
promptName?: string,
|
||||
promptToggles?: {key: string, value: string}[],
|
||||
promptText?: OpenAIChat[],
|
||||
}
|
||||
|
||||
interface AINsettings{
|
||||
top_p: number,
|
||||
rep_pen: number,
|
||||
@@ -1883,6 +1922,7 @@ import type { Parameter } from '../process/request';
|
||||
import type { HypaModel } from '../process/memory/hypamemory';
|
||||
import type { SerializableHypaV3Data } from '../process/memory/hypav3';
|
||||
import { defaultHotkeys, type Hotkey } from '../defaulthotkeys';
|
||||
import type { OpenAIChat } from '../process/index.svelte';
|
||||
|
||||
export async function downloadPreset(id:number, type:'json'|'risupreset'|'return' = 'json'){
|
||||
saveCurrentPreset()
|
||||
@@ -2071,7 +2111,7 @@ export async function importPreset(f:{
|
||||
}
|
||||
else{
|
||||
console.log("Prompt not found", prompt)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(pre?.assistant_prefill){
|
||||
|
||||
Reference in New Issue
Block a user