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