[fix] ooba force new api
This commit is contained in:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user