[Updated Plugin] ChatGPT with Real-Time Streaming (No more timeouts!)

@buildingsomething - I’m not sure what you mean by “the message history is set quicker than the first records are saved”. Do you mean you have a workflow that runs “Make changes to thing”, to modify a database record, then “Set Message History”, and that “Set Message History” is running before the DB action completes?

If so, that can happen with Bubble workflows; the actions don’t always run in order. There is a great post here from Bubble support on the topic:

The “custom event” approach is mentioned in that post, but basically the idea is, if you need things to run in a predefined order, you can “wrap” them in a Custom Event. So you create a custom event to run, e.g, Set Message History, and call that in your workflow where you need it, instead of just calling Set Message History directly. It’s a bit awkward, and non-intuitive, but it seems to work with Set/Clear Message History.

Another option (also covered in that post) is to have steps depend on results of previous steps. So, you could do something like:

  1. Create a DB record in Step 1, and set its “message history” field
  2. Then call Set Message History, setting the value to the “Result of Step 1’s Message History” (or w/e you called the DB field)

or something along these lines.

re: the Data Container functioning like a repeating group: the container’s Message History and DIsplay Messages are updated in real-time, as messages come in. And when you save to your database, that’s best done with the “Message Generation Complete” event (ie., create a workflow that fires when that happens, and update a database record’s Message History and Display Messages with the values in the container, as in the tutorial vid from today). You shouldn’t need to do any “real-time” data loading, per se, as this should be handled automatically.

Let me know if any of this helps!