Not valid JSON response message for valid JSON response
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3571490. --> Reported by: [merilainen](https://www.drupal.org/user/304437) Related to !1160 >>> <p>[Tracker]<br> <strong>Update Summary: </strong>Handle cases when the ChatMessage object contains valid JSON<br> <strong>Short Description: </strong>Handle cases when the ChatMessage object contains valid JSON<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>I get an error similar to:<br> <code>The response was not a valid JSON response. The response was: [{"value":{"uri":"http://example.com","title":"Title of the url"}}]</code><br> where there is a valid JSON object in the error message. The array has about 60 items in reality, but for the example I shortened it.</p> <h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4> <p>Please provide information like AI modules enabled, which AI provider, browser, etc.<br> Using OpenAI provider and LLM: Link to collect links from a given source.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Handle cases when the ChatMessage object contains valid JSON.</p> <h3 id="summary-ai-usage">AI usage (if applicable)</h3> <p>[ ] AI Assisted Issue<br> This issue was generated with AI assistance, but was reviewed and refined by the creator.</p> <p>[ ] AI Assisted Code<br> This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p> <p>[x] AI Generated Code<br> This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p> <p>[ ] Vibe Coded<br> This code was generated by an AI and has only been functionally tested.</p>
issue