[fix] name appending wrong
This commit is contained in:
17
src/etc/updateLog.ts
Normal file
17
src/etc/updateLog.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export const patchNote = {
|
||||
version: "1.68.0",
|
||||
content:
|
||||
`
|
||||
- Added Post End
|
||||
- Added Send Chat as System
|
||||
- Added Utility Override
|
||||
- Minor fixes
|
||||
`
|
||||
}
|
||||
|
||||
export function getPatchNote(version: string){
|
||||
if(patchNote.version.split(".")[1] === version.split(".")[1] && patchNote.version.split(".")[0] === version.split(".")[0]){
|
||||
return patchNote.content
|
||||
}
|
||||
return ''
|
||||
}
|
||||
@@ -469,7 +469,7 @@ export const languageEnglish = {
|
||||
assistantPrefill: "Assistant Prefill",
|
||||
postEndInnerFormat: "Post End",
|
||||
sendChatAsSystem: "Send Chat as System",
|
||||
sendName: "Send Name",
|
||||
sendName: "Send Name on Non-group Chat",
|
||||
utilOverride: "Utility Override",
|
||||
template: "Template",
|
||||
|
||||
|
||||
@@ -625,6 +625,7 @@ export async function getRisuHub(arg?:{
|
||||
page?:number,
|
||||
nsfw?:boolean
|
||||
sort?:string
|
||||
updateData?:boolean
|
||||
}):Promise<hubType[]> {
|
||||
try {
|
||||
const da = await fetch(hubURL + '/hub/list', {
|
||||
|
||||
@@ -11,7 +11,6 @@ export function polyfill() {
|
||||
testDom.remove()
|
||||
|
||||
if((!supports) || isIos){
|
||||
console.log('polyfiled dragdrop')
|
||||
globalThis.polyfilledDragDrop = true
|
||||
dragPolyfill({
|
||||
// use this to make use of the scroll behaviour
|
||||
@@ -20,9 +19,6 @@ export function polyfill() {
|
||||
forceApply: true
|
||||
});
|
||||
}
|
||||
else{
|
||||
console.log("supports dragdrop")
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface OpenAIChat{
|
||||
memo?:string
|
||||
name?:string
|
||||
removable?:boolean
|
||||
attr?:string[]
|
||||
}
|
||||
|
||||
export interface OpenAIChatFull extends OpenAIChat{
|
||||
@@ -566,11 +567,18 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
}
|
||||
}
|
||||
|
||||
let attr:string[] = []
|
||||
|
||||
if(nowChatroom.type === 'group'){
|
||||
formedChat = name + ': ' + formedChat
|
||||
attr.push('nameAdded')
|
||||
}
|
||||
|
||||
const chat:OpenAIChat = {
|
||||
role: msg.role === 'user' ? 'user' : 'assistant',
|
||||
content: formedChat,
|
||||
memo: msg.chatId,
|
||||
name: name
|
||||
attr: attr
|
||||
}
|
||||
chats.push(chat)
|
||||
currentTokens += await tokenizer.tokenizeChat(chat)
|
||||
@@ -1269,8 +1277,13 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
|
||||
function systemizeChat(chat:OpenAIChat[]){
|
||||
for(let i=0;i<chat.length;i++){
|
||||
if(chat[i].role === 'user' || chat[i].role === 'assistant'){
|
||||
chat[i].content = chat[i].role + ': ' + chat[i].content
|
||||
const attr = chat[i].attr ?? []
|
||||
if(!attr.includes('nameAdded')){
|
||||
chat[i].content = chat[i].role + ': ' + chat[i].content
|
||||
}
|
||||
chat[i].role = 'system'
|
||||
delete chat[i].memo
|
||||
delete chat[i].name
|
||||
}
|
||||
}
|
||||
return chat
|
||||
|
||||
@@ -110,6 +110,7 @@ export interface OpenAIChatExtra {
|
||||
memo?:string
|
||||
name?:string
|
||||
removable?:boolean
|
||||
attr?:string[]
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +134,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
raiModel = 'reverse_proxy'
|
||||
}
|
||||
}
|
||||
console.log(formated)
|
||||
switch(raiModel){
|
||||
case 'gpt35':
|
||||
case 'gpt35_0613':
|
||||
@@ -153,7 +155,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
case 'mistral-medium':
|
||||
case 'reverse_proxy':{
|
||||
let formatedChat:OpenAIChatExtra[] = []
|
||||
console.log(formated)
|
||||
if(db.inlayImage){
|
||||
let pendingImages:OpenAIImageContents[] = []
|
||||
for(let i=0;i<formated.length;i++){
|
||||
@@ -192,10 +193,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
let oobaSystemPrompts:string[] = []
|
||||
for(let i=0;i<formatedChat.length;i++){
|
||||
if(formatedChat[i].role !== 'function'){
|
||||
if(arg.isGroupChat && formatedChat[i].name){
|
||||
formatedChat[i].content = formatedChat[i].name + ": " + formatedChat[i].content
|
||||
formatedChat[i].name = undefined
|
||||
}
|
||||
if(!(formatedChat[i].name && formatedChat[i].name.startsWith('example_') && db.newOAIHandle)){
|
||||
formatedChat[i].name = undefined
|
||||
}
|
||||
@@ -204,6 +201,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
}
|
||||
delete formatedChat[i].memo
|
||||
delete formatedChat[i].removable
|
||||
delete formatedChat[i].attr
|
||||
}
|
||||
if(aiModel === 'reverse_proxy' && db.reverseProxyOobaMode && formatedChat[i].role === 'system'){
|
||||
const cont = formatedChat[i].content
|
||||
|
||||
Reference in New Issue
Block a user