It could be me using Chat for the first time, but I noticed that if I used a file upload, and generated code, the initial message was:
convo.send_message("<div class=\"document-embed drive-embed\" data-drive-file-name=\"adobe_security_properly_ocr.pdf\" data-drive-file-id=\"1IoNP2UYfUYbcyHtcvR7gQ1wFmWIzZZ-6\" data-drive-file-or-folder-id=\"1IoNP2UYfUYbcyHtcvR7gQ1wFmWIzZZ-6\" data-drive-folder-name=\"\" data-blot-name=\"document-embed\" contenteditable=\"false\"><div class=\"inner-container\"><span class=\"document-embed-loading google-symbols\">progress_activity</span><span class=\"document-embed-icon material-symbols-outlined\" aria-hidden=\"true\">docs</span><span class=\"document-embed-label gmat-body-medium truncate\" title=\"adobe_security_properly_ocr.pdf\" alt=\"adobe_security_properly_ocr.pdf\" aria-label=\"adobe_security_properly_ocr.pdf\">adobe_security_properly_ocr.pdf</span><span class=\"document-embed-token-count gmat-body-medium\">Extracting</span></div></div>")
Note the use of divs, one for the embed, some spans for the token count too I think. All in all it feels ‘wrong’ - is it?