RetoolAI Query: Variables are not loaded in chat component

  • Goal: I am trying to parse the data from a table (using json.stringify) into a retool AI query to use with the chat component.

The problem is that (even though the data exists) the query that is send via the chat component doesn't seem to contain the data, I.e. the variable has not been inserted correctly.
However, when I manually run the query in the editor, the data is displayed and included correctly in the query and the model gives a correct answer.

In short: Variables get set correctly when running the retool ai query manually in the editor, but don't work when running the same query from within the chat component.

  • Steps: I've tried to set the data as a variable first, to be sure it is loaded correctly before the query gets send. The problem remains. Also I've added a console.log that gets triggered when a message is send in the chat component to verify again that the data does exist.

  • Screenshots:
    Clearly the mapping data does exist. When I press on "run" in the editor, everything works fine and a correct response is displayed in the chat component.
    The query:

Correct response:

However, when I run the same query via the chat component, the model doesn't receive the data:

Edit:
The workaround seems to be to create a shared query in the query library and in particular leave the chat history field empty.
In this case the chat component works just like running the query manually. So there must be some conflict between the chat history and the data variable.

Hey @CasCodes - looks like a bug, we're on it.

2 Likes

Hey @CasCodes ! I saw that you tried to include the app export, but the link you provided is actually not to the JSON. Could you reupload the export?

Oh sorry, I can't share the app. The link was just from the template.

Hey @CasCodes, we found and resolved the issue. The fix should be available from v3.132 onward, let us know if you still have the issue

3 Likes

Thanks for the support!