[fix] koboldai
This commit is contained in:
@@ -37,6 +37,7 @@ export async function requestChatData(arg:requestDataArgument, model:'model'|'su
|
|||||||
if(da.type === 'success' || da.type === 'streaming' || da.noRetry){
|
if(da.type === 'success' || da.type === 'streaming' || da.noRetry){
|
||||||
return da
|
return da
|
||||||
}
|
}
|
||||||
|
|
||||||
trys += 1
|
trys += 1
|
||||||
if(trys > db.requestRetrys){
|
if(trys > db.requestRetrys){
|
||||||
return da
|
return da
|
||||||
@@ -423,8 +424,8 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
case "kobold":{
|
case "kobold":{
|
||||||
const proompt = stringlizeChat(formated, currentChar?.name ?? '')
|
const proompt = stringlizeChat(formated, currentChar?.name ?? '')
|
||||||
const url = new URL(db.koboldURL)
|
const url = new URL(db.koboldURL)
|
||||||
url.pathname = '/generate'
|
url.pathname = 'api/v1/generate'
|
||||||
|
|
||||||
const da = await fetch(url, {
|
const da = await fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
@@ -446,7 +447,10 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await da.json()
|
const data = await da.json()
|
||||||
return data.results[0].text
|
return {
|
||||||
|
type: 'success',
|
||||||
|
result: data.results[0].text
|
||||||
|
}
|
||||||
}
|
}
|
||||||
default:{
|
default:{
|
||||||
if(aiModel.startsWith("horde:::")){
|
if(aiModel.startsWith("horde:::")){
|
||||||
|
|||||||
Reference in New Issue
Block a user