From dfba64e0ae4cac76eab27c5a2e6ad0f6a897a0e0 Mon Sep 17 00:00:00 2001 From: hanishkvc Date: Sun, 9 Nov 2025 23:55:53 +0530 Subject: [PATCH] SimpleChatTCRV:Vision: Create needed MixedContent b4 nw handshake --- tools/server/public_simplechat/simplechat.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index d313bf33ff..3d75ded4cc 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -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>>} 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