jacob-ai-bot / jacob

Just Another Coding Bot
https://jacb.ai
Apache License 2.0
96 stars 13 forks source link

Architect a more scalable way of rendering dynamic buttons in chat #62

Open kleneway opened 2 months ago

kleneway commented 2 months ago

One important feature of the JACoB chat interface is the ability for the AI to display dynamic buttons that will trigger workflows such as creating/updating a new GitHub issue. Here is the current process for how the buttons are displayed:

As we start to add more functionality to the web portal, this approach does not scale well as we need to continually pass more and more functions into this child component, conditionally render each button, etc.. We also have issues where the LLM will output part of the instruction prompt with the tag (i.e. ===== <> =====).

There must be a better way to handle this type of situation, ideally without resorting to adding a state management library like redux to handle passing the params to the child. High level it might look something like this: