Support structured output for assistant runner to allow for dynamic properties in DeepChat API response
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3551983. --> Reported by: [lpeabody](https://www.drupal.org/user/1137356) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>The goal of this is to be able to communicate additional data to the Deep Chat UI by taking advantage of AI agents being able to utilize structured output. My use case is I have an orchestrator agent that can speak with three additional sub-agents. When the orchestrator is ready to give its final response, I would like it to return the response by adhering to the JSON schema I've specified. With the structured response in hand, I can send this additional data in the response to Deep Chat.</p> <p>I can then look for these parameters in the JSON response. For example, part of the structured output schema might include "emotional_user_state" as an enum or "suggested_next_questions" as an array of 1-3 strings. I could then push the "emotional_user_state" as a custom dimension to Google Analytics and inject into the chat the "suggest_next_questions" using "Suggestion buttons" like in the example <a href="https://deepchat.dev/docs/messages/HTML#moreExamples">https://deepchat.dev/docs/messages/HTML#moreExamples</a>.</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.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue