Make it possible to serialize ChatMessage when an image exists
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3567244. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !1093 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>[One-line status update for stakeholders]<br> <strong>Short Description: </strong>[One-line issue summary for stakeholders]<br> <strong>Check-in Date: </strong>MM/DD/YYYY<br> <em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br> [/Tracker]</p> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently you can not serialize the ChatInput with images, because it tries to store it as binary.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Try to create a ChatInput with an image attached to it and try to run toArray and then fromArray on the same data.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Fix so its using base64 instead.</p> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue