I think there may be several things/workarounds you can try.
Firstly, can you clarify which component you're using? Is it the llm chat, or the agent chat?
Second, which method are you using to get the llm to respond in a Json, is it simply the system prompt where you provide the instructions, or are you using another query with structured outputs?
Finally, when you say the component is sandboxed, what do you exactly mean? Both the llm and agent chat components have the conversation threads available, after a turn in conversation, you can right click on the component -> View status, and search for the conversation results.
If you can add more context to which AI tool you are using and if this is from one of the chat components or from an AI query we can better help assist you to take this data and store it in a way that fits your use case!
The more details and screen shots you can share, the better!
Just wanted to follow up on this to see if you are still facing this issue.
We do not have a built in "when x event occurs, run a JS Query" which would be the primary way of executing code to effect another component while a user is messaging an LLM via a chat component.
But there may be some work arounds, as Miguel asked about the set up so we can have more details to test out possible work arounds.