[feat] added v2 spec additions to character
This commit is contained in:
@@ -211,6 +211,11 @@ export const languageEnglish = {
|
|||||||
editOutput: "Modfiy Output",
|
editOutput: "Modfiy Output",
|
||||||
editProcess: "Modfiy Request Data",
|
editProcess: "Modfiy Request Data",
|
||||||
loadLatest: "Load Latest Backup",
|
loadLatest: "Load Latest Backup",
|
||||||
loadOthers: "Load Other Backups"
|
loadOthers: "Load Other Backups",
|
||||||
|
exampleMessage: "Example Message",
|
||||||
|
creatorNotes: "Creator's Quote",
|
||||||
|
systemPrompt: "System Prompt",
|
||||||
|
characterNotes: "Character Notes",
|
||||||
|
personality: "Personality",
|
||||||
|
alternateGreetings: "Alternate Greetings"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,5 +208,5 @@ export const languageKorean = {
|
|||||||
editOutput: "출력문 수정",
|
editOutput: "출력문 수정",
|
||||||
editProcess: "리퀘스트 데이터 수정",
|
editProcess: "리퀘스트 데이터 수정",
|
||||||
loadLatest: "가장 최근 백업 불러오기",
|
loadLatest: "가장 최근 백업 불러오기",
|
||||||
loadOthers: "다른 백업 불러오기"
|
loadOthers: "다른 백업 불러오기",
|
||||||
}
|
}
|
||||||
@@ -426,6 +426,23 @@
|
|||||||
<Check bind:check={currentChar.data.utilityBot}/>
|
<Check bind:check={currentChar.data.utilityBot}/>
|
||||||
<span>{language.utilityBot}</span>
|
<span>{language.utilityBot}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<span class="text-neutral-200">{language.exampleMessage}</span>
|
||||||
|
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-20 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.exampleMessage}></textarea>
|
||||||
|
|
||||||
|
<span class="text-neutral-200">{language.creatorNotes} <Help key="charFirstMessage"/></span>
|
||||||
|
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-20 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.firstMessage}></textarea>
|
||||||
|
|
||||||
|
<span class="text-neutral-200">{language.systemPrompt} <Help key="charFirstMessage"/></span>
|
||||||
|
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-20 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.firstMessage}></textarea>
|
||||||
|
|
||||||
|
<span class="text-neutral-200">{language.characterNotes} <Help key="charFirstMessage"/></span>
|
||||||
|
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-20 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.firstMessage}></textarea>
|
||||||
|
|
||||||
|
<span class="text-neutral-200">{language.personality} <Help key="charFirstMessage"/></span>
|
||||||
|
<textarea class="bg-transparent input-text mt-2 mb-2 text-gray-200 text-xs resize-none h-20 focus:bg-selected" autocomplete="off" bind:value={currentChar.data.firstMessage}></textarea>
|
||||||
|
|
||||||
|
|
||||||
<button on:click={async () => {
|
<button on:click={async () => {
|
||||||
exportChar($selectedCharID)
|
exportChar($selectedCharID)
|
||||||
}} class="text-neutral-200 mt-6 text-lg bg-transparent border-solid border-1 border-borderc p-4 hover:bg-green-500 transition-colors cursor-pointer">{language.exportCharacter}</button>
|
}} class="text-neutral-200 mt-6 text-lg bg-transparent border-solid border-1 border-borderc p-4 hover:bg-green-500 transition-colors cursor-pointer">{language.exportCharacter}</button>
|
||||||
|
|||||||
@@ -160,20 +160,11 @@ export async function characterHubImport() {
|
|||||||
|
|
||||||
function convertOldTavernAndJSON(charaData:OldTavernChar, imgp:string|undefined = undefined):character{
|
function convertOldTavernAndJSON(charaData:OldTavernChar, imgp:string|undefined = undefined):character{
|
||||||
|
|
||||||
let desc = charaData.description ?? ''
|
|
||||||
|
|
||||||
if(charaData.personality){
|
|
||||||
desc += '\n\n' + charaData.personality
|
|
||||||
}
|
|
||||||
|
|
||||||
if(charaData.scenario){
|
|
||||||
desc += '\n\n' + charaData.scenario
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: charaData.name ?? 'unknown name',
|
name: charaData.name ?? 'unknown name',
|
||||||
firstMessage: charaData.first_mes ?? 'unknown first message',
|
firstMessage: charaData.first_mes ?? 'unknown first message',
|
||||||
desc: desc,
|
desc: charaData.description ?? '',
|
||||||
notes: '',
|
notes: '',
|
||||||
chats: [{
|
chats: [{
|
||||||
message: [],
|
message: [],
|
||||||
@@ -191,7 +182,16 @@ function convertOldTavernAndJSON(charaData:OldTavernChar, imgp:string|undefined
|
|||||||
sdData: defaultSdDataFunc(),
|
sdData: defaultSdDataFunc(),
|
||||||
utilityBot: false,
|
utilityBot: false,
|
||||||
customscript: [],
|
customscript: [],
|
||||||
exampleMessage: charaData.mes_example
|
exampleMessage: charaData.mes_example,
|
||||||
|
creatorNotes:'',
|
||||||
|
systemPrompt:'',
|
||||||
|
postHistoryInstructions:'',
|
||||||
|
alternateGreetings:[],
|
||||||
|
tags:[],
|
||||||
|
creator:"",
|
||||||
|
characterVersion: 0,
|
||||||
|
personality: charaData.personality ?? '',
|
||||||
|
scenario:charaData.scenario ?? '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,10 +320,10 @@ async function importSpecv2(card:CharacterCardV2, img?:Uint8Array):Promise<boole
|
|||||||
}
|
}
|
||||||
|
|
||||||
let char:character = {
|
let char:character = {
|
||||||
name: data.name,
|
name: data.name ?? '',
|
||||||
firstMessage: data.first_mes,
|
firstMessage: data.first_mes ?? '',
|
||||||
desc: data.description,
|
desc: data.description ?? '',
|
||||||
notes: data.post_history_instructions,
|
notes: '',
|
||||||
chats: [{
|
chats: [{
|
||||||
message: [],
|
message: [],
|
||||||
note: '',
|
note: '',
|
||||||
@@ -340,7 +340,16 @@ async function importSpecv2(card:CharacterCardV2, img?:Uint8Array):Promise<boole
|
|||||||
sdData: sdData,
|
sdData: sdData,
|
||||||
utilityBot: utilityBot,
|
utilityBot: utilityBot,
|
||||||
customscript: customScripts,
|
customscript: customScripts,
|
||||||
exampleMessage: data.mes_example
|
exampleMessage: data.mes_example ?? '',
|
||||||
|
creatorNotes:data.creator_notes ?? '',
|
||||||
|
systemPrompt:data.system_prompt ?? '',
|
||||||
|
postHistoryInstructions:data.post_history_instructions ?? '',
|
||||||
|
alternateGreetings:data.alternate_greetings ?? [],
|
||||||
|
tags:data.tags ?? [],
|
||||||
|
creator:data.creator ?? '',
|
||||||
|
characterVersion: data.character_version ?? 0,
|
||||||
|
personality:data.personality ?? '',
|
||||||
|
scenario:data.scenario ?? '',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,16 @@ export function createBlankChar():character{
|
|||||||
sdData: defaultSdDataFunc(),
|
sdData: defaultSdDataFunc(),
|
||||||
utilityBot: false,
|
utilityBot: false,
|
||||||
customscript: [],
|
customscript: [],
|
||||||
exampleMessage: ''
|
exampleMessage: '',
|
||||||
|
creatorNotes:'',
|
||||||
|
systemPrompt:'',
|
||||||
|
postHistoryInstructions:'',
|
||||||
|
alternateGreetings:[],
|
||||||
|
tags:[],
|
||||||
|
creator:"",
|
||||||
|
characterVersion: 0,
|
||||||
|
personality:"",
|
||||||
|
scenario:"",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -238,6 +238,16 @@ export interface character{
|
|||||||
customscript: customscript[]
|
customscript: customscript[]
|
||||||
utilityBot: boolean
|
utilityBot: boolean
|
||||||
exampleMessage:string
|
exampleMessage:string
|
||||||
|
|
||||||
|
creatorNotes:string
|
||||||
|
systemPrompt:string
|
||||||
|
postHistoryInstructions:string
|
||||||
|
alternateGreetings:string[]
|
||||||
|
tags:string[]
|
||||||
|
creator:string
|
||||||
|
characterVersion: number
|
||||||
|
personality:string
|
||||||
|
scenario:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface groupChat{
|
export interface groupChat{
|
||||||
|
|||||||
Reference in New Issue
Block a user