[fix] ooba force new api

This commit is contained in:
kwaroran
2023-07-09 17:26:53 +09:00
parent 8ba2c24674
commit 5f8be5a06c

View File

@@ -349,7 +349,6 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
let DURL = db.textgenWebUIURL let DURL = db.textgenWebUIURL
let bodyTemplate:any let bodyTemplate:any
const proompt = stringlizeChatOba(formated, currentChar?.name ?? '') const proompt = stringlizeChatOba(formated, currentChar?.name ?? '')
const isNewAPI = DURL.includes('api')
if(!DURL.endsWith('generate')){ if(!DURL.endsWith('generate')){
DURL = DURL + "/v1/generate" DURL = DURL + "/v1/generate"
} }
@@ -386,7 +385,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
const dat = res.data as any const dat = res.data as any
if(res.ok){ if(res.ok){
try { try {
let result:string = isNewAPI ? dat.results[0].text : dat.data[0].substring(proompt.length) let result:string = dat.results[0].text
return { return {
type: 'success', type: 'success',