Add thread id and parent id to AI calls.
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3515879. --> Reported by: [marcus_johansson](https://www.drupal.org/user/385947) Related to !538 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Currently we have all the information being logged from the raw output in theory and some of the provider information (provider id, model) and some dynamic measured content like processing time.</p> <p>There is one very important piece missing and that is nested prompts. One example with this is for instance when one agents chooses to pick another agent. We are not aware that they are actually connected.</p> <p>What we want to do is to set an unique thread id on each request, and also make sure that an application can set that thread id as a parent id on any child request.</p> <p>If we have this information, making agent logging should be possible in any visual way.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a method that automatically sets an unique id or use the event id for this.<br> Add a getter method for it.<br> Add a method to set an optional parent id.</p>
issue