Add fallbacks
This commit is contained in:
@@ -1836,10 +1836,11 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
delete body.systemInstruction
|
delete body.systemInstruction
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!arg.imageResponse){
|
if(arg.imageResponse){
|
||||||
body.generation_config.responseModalities = [
|
body.generation_config.responseModalities = [
|
||||||
'TEXT', 'IMAGE'
|
'TEXT', 'IMAGE'
|
||||||
]
|
]
|
||||||
|
arg.useStreaming = false
|
||||||
}
|
}
|
||||||
|
|
||||||
let headers:{[key:string]:string} = {}
|
let headers:{[key:string]:string} = {}
|
||||||
@@ -2079,14 +2080,15 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
rDatas.push('')
|
rDatas.push('')
|
||||||
}
|
}
|
||||||
|
|
||||||
rDatas[rDatas.length-1] += part.text ?? ''
|
// Due to error, do not use this
|
||||||
if(part.inlineData){
|
// rDatas[rDatas.length-1] += part.text ?? ''
|
||||||
const imgHTML = new Image()
|
// if(part.inlineData){
|
||||||
const id = crypto.randomUUID()
|
// const imgHTML = new Image()
|
||||||
imgHTML.src = `data:${part.inlineData.mimeType};base64,${part.inlineData.data}`
|
// const id = crypto.randomUUID()
|
||||||
writeInlayImage(imgHTML)
|
// imgHTML.src = `data:${part.inlineData.mimeType};base64,${part.inlineData.data}`
|
||||||
rDatas[rDatas.length-1] += (`\n{{inlayeddata::${id}}}\n`)
|
// writeInlayImage(imgHTML)
|
||||||
}
|
// rDatas[rDatas.length-1] += (`\n{{inlayeddata::${id}}}\n`)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2107,12 +2109,15 @@ async function requestGoogleCloudVertex(arg:RequestDataArgumentExtended):Promise
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(rDatas[rDatas.length-1])
|
||||||
|
|
||||||
control.enqueue({
|
control.enqueue({
|
||||||
'0': rDatas[rDatas.length-1],
|
'0': rDatas[rDatas.length-1],
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},)
|
},)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user