SimpleChatTCRV:Vision: Create needed MixedContent b4 nw handshake

This commit is contained in:
hanishkvc 2025-11-09 23:55:53 +05:30
parent 72f62eed0f
commit dfba64e0ae
1 changed files with 15 additions and 0 deletions

View File

@ -55,6 +55,8 @@ class ApiEP {
/**
* THis is created and used only in recent_chat_ns
* and inturn directly sent over the network, without any addiitional processing.
* @typedef {Array<Object<string, string|Object<string, string>>>} NSMixedContent
*/
@ -559,6 +561,19 @@ class SimpleChat {
if (tmsg.ns.getReasoningContent() === "") {
tmsg.ns_delete("reasoning_content")
}
if (tmsg.ns.image_url) {
// Has I need to know if really there or if undefined, so direct access and not through getContent helper.
let tContent = tmsg.ns.content
/** @type{NSMixedContent} */
let tMixed = []
if (tContent) {
tMixed.push({"type": "text", "text": tContent})
}
tMixed.push({"type": "image_url", "image_url": {"url": tmsg.ns.image_url}})
// @ts-ignore
tmsg.ns.content = tMixed
tmsg.ns_delete("image_url")
}
chat.push(tmsg.ns);
}
return chat