[fix] kobold cors
This commit is contained in:
@@ -426,7 +426,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
const url = new URL(db.koboldURL)
|
const url = new URL(db.koboldURL)
|
||||||
url.pathname = 'api/v1/generate'
|
url.pathname = 'api/v1/generate'
|
||||||
|
|
||||||
const da = await fetch(url, {
|
const da = await globalFetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"prompt": proompt,
|
"prompt": proompt,
|
||||||
@@ -438,15 +438,15 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if(da.status !== 200){
|
if(!da.ok){
|
||||||
return {
|
return {
|
||||||
type: "fail",
|
type: "fail",
|
||||||
result: await da.text(),
|
result: da.data,
|
||||||
noRetry: da.status >= 500
|
noRetry: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await da.json()
|
const data = da.data
|
||||||
return {
|
return {
|
||||||
type: 'success',
|
type: 'success',
|
||||||
result: data.results[0].text
|
result: data.results[0].text
|
||||||
|
|||||||
Reference in New Issue
Block a user