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