Quansight / ragna

RAG orchestration framework ⛵️
https://ragna.chat
BSD 3-Clause "New" or "Revised" License
179 stars 22 forks source link

[ENH] - Automatically Handle Unprepared Chats in the UI #448

Open arjxn-py opened 4 months ago

arjxn-py commented 4 months ago

Feature description

Currently, if a chat is created via the API but not prepared, it can lead to an intermediate state where the chat appears empty and unprepared in the UI. This situation arises because creating a chat through the API is a two-step process:

  1. Creating the chat: https://github.com/Quansight/ragna/blob/55f7fc5d3d13f321eebd16d3b0901ab35ac36bc7/scripts/add_chats.py#L51-L64

  2. Preparing the chat: https://github.com/Quansight/ragna/blob/55f7fc5d3d13f321eebd16d3b0901ab35ac36bc7/scripts/add_chats.py#L66

In the UI, these steps are performed back-to-back, ensuring the user is not left in an intermediate state. However, if the UI is started after creating the chat via the API and the chat has not been prepared, the user will see an empty chat that is unprepared and can further cause errors while handling the chats.

Proposed Solution

Automatic preparation: Implement functionality in the UI to detect when an unprepared chat is selected and trigger the preparation process automatically.

Value and/or benefit

Automatically handling unprepared chats in the UI prevents errors and improves UX

Anything else?

Originally been discussed by @pmeier in 445#comment